From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 03:00:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 721D4106564A; Sun, 31 Jul 2011 03:00:00 +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 5E01B8FC12; Sun, 31 Jul 2011 03:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V300LD026212; Sun, 31 Jul 2011 03:00:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V3003d026210; Sun, 31 Jul 2011 03:00:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107310300.p6V3003d026210@svn.freebsd.org> From: Xin LI Date: Sun, 31 Jul 2011 03:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224535 - head/usr.sbin/pw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 03:00:00 -0000 Author: delphij Date: Sun Jul 31 03:00:00 2011 New Revision: 224535 URL: http://svn.freebsd.org/changeset/base/224535 Log: Backout r223115 which potentially caused a POLA violation, by restoring historic behavior (create the default base directory in pw.conf) before I came up with a better fix for this. Requested by: nwhitehorn Approved by: re (kib) Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sat Jul 30 23:42:15 2011 (r224534) +++ head/usr.sbin/pw/pw_user.c Sun Jul 31 03:00:00 2011 (r224535) @@ -163,7 +163,7 @@ pw_user(struct userconf * cnf, int mode, * If we'll need to use it or we're updating it, * then create the base home directory if necessary */ - if ((arg != NULL || getarg(args, 'm') != NULL) && (getarg(args, 'd') == NULL)) { + if (arg != NULL || getarg(args, 'm') != NULL) { int l = strlen(cnf->home); if (l > 1 && cnf->home[l-1] == '/') /* Shave off any trailing path delimiter */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 03:12:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DD8B106566B; Sun, 31 Jul 2011 03:12:20 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 733A88FC14; Sun, 31 Jul 2011 03:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V3CKO3026920; Sun, 31 Jul 2011 03:12:20 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V3CKLw026918; Sun, 31 Jul 2011 03:12:20 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201107310312.p6V3CKLw026918@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 31 Jul 2011 03:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224536 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 03:12:20 -0000 Author: rodrigc Date: Sun Jul 31 03:12:20 2011 New Revision: 224536 URL: http://svn.freebsd.org/changeset/base/224536 Log: In the old TFTP server, there was an undocumented behavior where the block counter would rollover to 0 if a file larger than 65535 blocks was transferred. With the default block size of 512 octets per block, this is a file size of approximately 32 megabytes. The new TFTP server code would report an error and stop transferring the file if a file was larger than 65535 blocks. This patch restores the old TFTP server's behavior to the new TFTP server code. If a TFTP client transfers a file larger than 65535 blocks, and does *not* specify the "rollover" option, then automatically rollover the block counter to 0 every time we reach 65535 blocks. This restores interoperability with the FreeBSD 6 TFTP client. Without this change, if a FreeBSD 6 TFTP client tried to retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server , the transfer would fail. The same file could be retrieved successfully if the same FreeBSD 6 TFTP client was used against a FreeBSD 6 TFTP server. Approved by: re (kib) Tested by: Pawan Gupta , Obtained from: Juniper Networks Modified: head/libexec/tftpd/tftp-transfer.c Modified: head/libexec/tftpd/tftp-transfer.c ============================================================================== --- head/libexec/tftpd/tftp-transfer.c Sun Jul 31 03:00:00 2011 (r224535) +++ head/libexec/tftpd/tftp-transfer.c Sun Jul 31 03:12:20 2011 (r224536) @@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, str (*block)++; if (oldblock > *block) { if (options[OPT_ROLLOVER].o_request == NULL) { - tftp_log(LOG_ERR, - "Block rollover but not allowed."); - send_error(peer, EBADOP); - gettimeofday(&(ts->tstop), NULL); - return; + /* + * "rollover" option not specified in + * tftp client. Default to rolling block + * counter to 0. + */ + *block = 0; + } else { + *block = atoi(options[OPT_ROLLOVER].o_request); } - *block = atoi(options[OPT_ROLLOVER].o_request); ts->rollovers++; } gettimeofday(&(ts->tstop), NULL); @@ -196,14 +198,16 @@ tftp_receive(int peer, uint16_t *block, (*block)++; if (oldblock > *block) { if (options[OPT_ROLLOVER].o_request == NULL) { - tftp_log(LOG_ERR, - "Block rollover but not allowed."); - send_error(peer, EBADOP); - gettimeofday(&(ts->tstop), NULL); - return; + /* + * "rollover" option not specified in + * tftp client. Default to rolling block + * counter to 0. + */ + *block = 0; + } else { + *block = atoi(options[OPT_ROLLOVER].o_request); } - *block = atoi(options[OPT_ROLLOVER].o_request); ts->rollovers++; } From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 03:18:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842C61065670; Sun, 31 Jul 2011 03:18:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59BD98FC08; Sun, 31 Jul 2011 03:18:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V3IapI027153; Sun, 31 Jul 2011 03:18:36 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V3Ia8n027151; Sun, 31 Jul 2011 03:18:36 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201107310318.p6V3Ia8n027151@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 31 Jul 2011 03:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224537 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 03:18:36 -0000 Author: rodrigc Date: Sun Jul 31 03:18:36 2011 New Revision: 224537 URL: http://svn.freebsd.org/changeset/base/224537 Log: Pull in some wording to the tftpd.8 man page from NetBSD, with some slight changes: ========================================================================================= http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/tftpd/tftpd.8?only_with_tag=MAIN#rev1.22 Revision 1.22 or diffs], Fri Jan 8 21:05:14 2010 UTC (18 months, 2 weeks ago) by christos Patrick Welche - add -p pathsep option - make wrap to zero work, but produce a warning While here: - fix gcc warnings, in particular variable clobbered warnings (compiling with fewer warnings does not really fix the problem) ========================================================================================= These wording changes clarify the default rollover behavior as a "kludge". Also, the block numbers and octet counts for 65535 blocks and 32767 blocks are more accurate than the existing documented numbers. Requested by: Pawan Gupta Obtained from: Juniper Networks Approved by: re (kib) Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Sun Jul 31 03:12:20 2011 (r224536) +++ head/libexec/tftpd/tftpd.8 Sun Jul 31 03:18:36 2011 (r224537) @@ -300,8 +300,15 @@ and .Xr tftp 1 code to support RFC2348. .Sh NOTES -Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting the TFTP blocksize option (RFC2348), +Files larger than 33,553,919 octets (65535 blocks, last one <512 +octets) cannot be correctly transferred without client and server +supporting blocksize negotiation (RFCs 2347 and 2348), or the non-standard TFTP rollover option. +As a kludge, +.Nm +accepts a sequence of block number which wrap to zero after 65535, +even if the rollover option is not specified. .Pp -Many tftp clients will not transfer files over 16744448 octets (32767 blocks). +Many tftp clients will not transfer files over 16,776,703 octets +(32767 blocks), as they incorrectly count the block number using +a signed rather than unsigned 16-bit integer. From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 03:33:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 167DF106566C; Sun, 31 Jul 2011 03:33:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05E968FC1B; Sun, 31 Jul 2011 03:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V3X2RW027622; Sun, 31 Jul 2011 03:33:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V3X2FO027620; Sun, 31 Jul 2011 03:33:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107310333.p6V3X2FO027620@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 Jul 2011 03:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224538 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 03:33:03 -0000 Author: adrian Date: Sun Jul 31 03:33:02 2011 New Revision: 224538 URL: http://svn.freebsd.org/changeset/base/224538 Log: Add some more phyerr bits. Obtained from: Atheros Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah_desc.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Sun Jul 31 03:18:36 2011 (r224537) +++ head/sys/dev/ath/ath_hal/ah_desc.h Sun Jul 31 03:33:02 2011 (r224538) @@ -158,6 +158,12 @@ enum { HAL_PHYERR_CCK_RATE_ILLEGAL = 27, /* */ HAL_PHYERR_CCK_SERVICE = 30, /* */ HAL_PHYERR_CCK_RESTART = 31, /* */ + HAL_PHYERR_CCK_LENGTH_ILLEGAL = 32, /* */ + HAL_PHYERR_CCK_POWER_DROP = 33, /* */ + /* AR5416 and later */ + HAL_PHYERR_HT_CRC_ERROR = 34, /* */ + HAL_PHYERR_HT_LENGTH_ILLEGAL = 35, /* */ + HAL_PHYERR_HT_RATE_ILLEGAL = 36, /* */ }; /* value found in rs_keyix to mark invalid entries */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 05:01:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261151065673; Sun, 31 Jul 2011 05:01:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 173918FC0A; Sun, 31 Jul 2011 05:01:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V51gvK030305; Sun, 31 Jul 2011 05:01:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V51gjG030303; Sun, 31 Jul 2011 05:01:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107310501.p6V51gjG030303@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 Jul 2011 05:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224539 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 05:01:43 -0000 Author: adrian Date: Sun Jul 31 05:01:42 2011 New Revision: 224539 URL: http://svn.freebsd.org/changeset/base/224539 Log: Add extra flags for the radar event API. (They're not used by any public code at the current time.) Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sun Jul 31 03:33:02 2011 (r224538) +++ head/sys/dev/ath/ath_hal/ah.h Sun Jul 31 05:01:42 2011 (r224539) @@ -747,6 +747,9 @@ typedef enum { } HAL_QUIET_FLAG; #define HAL_DFS_EVENT_PRICH 0x0000001 +#define HAL_DFS_EVENT_EXTCH 0x0000002 +#define HAL_DFS_EVENT_EXTEARLY 0x0000004 +#define HAL_DFS_EVENT_ISDC 0x0000008 struct dfs_event { uint64_t re_full_ts; /* 64-bit full timestamp from interrupt time */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 05:59:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8C7106566C; Sun, 31 Jul 2011 05:59:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF92E8FC08; Sun, 31 Jul 2011 05:59:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V5xXRP032006; Sun, 31 Jul 2011 05:59:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V5xXWl032004; Sun, 31 Jul 2011 05:59:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107310559.p6V5xXWl032004@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 Jul 2011 05:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224540 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 05:59:34 -0000 Author: adrian Date: Sun Jul 31 05:59:33 2011 New Revision: 224540 URL: http://svn.freebsd.org/changeset/base/224540 Log: Fix typo! Approved by: re (kib) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Jul 31 05:01:42 2011 (r224539) +++ head/sys/dev/ath/if_athvar.h Sun Jul 31 05:59:33 2011 (r224540) @@ -651,7 +651,7 @@ void ath_intr(void *); #define ath_hal_gettxchainmask(_ah, _ptxchainmask) \ (ath_hal_getcapability(_ah, HAL_CAP_TX_CHAINMASK, 0, _ptxchainmask)) #define ath_hal_split4ktrans(_ah) \ - (ath_hal_getcapability(_ah, HAP_CAP_SPLIT_4KB_TRANS, 0, NULL) == HAL_OK) + (ath_hal_getcapability(_ah, HAL_CAP_SPLIT_4KB_TRANS, 0, NULL) == HAL_OK) #define ath_hal_self_linked_final_rxdesc(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_RXDESC_SELFLINK, 0, NULL) == HAL_OK) #define ath_hal_gtxto_supported(_ah) \ From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 08:01:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76DD3106566B; Sun, 31 Jul 2011 08:01:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6418FC12; Sun, 31 Jul 2011 08:01:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V81f71035729; Sun, 31 Jul 2011 08:01:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V81fnH035727; Sun, 31 Jul 2011 08:01:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107310801.p6V81fnH035727@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 Jul 2011 08:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224541 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 08:01:42 -0000 Author: adrian Date: Sun Jul 31 08:01:41 2011 New Revision: 224541 URL: http://svn.freebsd.org/changeset/base/224541 Log: Implement the 4KB split transaction workaround for Merlin (AR9280). The AR9280 apparently has an issue with descriptors which straddle a page boundary (4k). I'm not yet sure whether I should use PAGE_SIZE in the calculations or whether I should use 4096; the reference code uses 4096. This patch fiddles with descriptor allocation so a descriptor entry doesn't straddle a 4kb address boundary. The descriptor memory allocation is made larger to contain extra descriptors and then the descriptor address is advanced to the next 4kb boundary where needed. I've tested this both on Merlin (AR9280) and non-Merlin (in this case, AR9160.) Obtained from: Linux, Atheros Approved by: re (kib) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jul 31 05:59:33 2011 (r224540) +++ head/sys/dev/ath/if_ath.c Sun Jul 31 08:01:41 2011 (r224541) @@ -2937,16 +2937,36 @@ ath_descdma_setup(struct ath_softc *sc, { #define DS2PHYS(_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) +#define ATH_DESC_4KB_BOUND_CHECK(_daddr, _len) \ + ((((u_int32_t)(_daddr) & 0xFFF) > (0x1000 - (_len))) ? 1 : 0) struct ifnet *ifp = sc->sc_ifp; - struct ath_desc *ds; + uint8_t *ds; struct ath_buf *bf; int i, bsize, error; + int desc_len; + + desc_len = sizeof(struct ath_desc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA: %u buffers %u desc/buf\n", __func__, name, nbuf, ndesc); dd->dd_name = name; - dd->dd_desc_len = sizeof(struct ath_desc) * nbuf * ndesc; + dd->dd_desc_len = desc_len * nbuf * ndesc; + + device_printf(sc->sc_dev, "desc_len: %d, nbuf=%d, ndesc=%d; dd_desc_len=%d\n", + desc_len, nbuf, ndesc, dd->dd_desc_len); + + /* + * Merlin work-around: + * Descriptors that cross the 4KB boundary can't be used. + * Assume one skipped descriptor per 4KB page. + */ + if (! ath_hal_split4ktrans(sc->sc_ah)) { + int numdescpage = 4096 / (desc_len * ndesc); + dd->dd_desc_len = (nbuf / numdescpage + 1) * 4096; + device_printf(sc->sc_dev, "numdescpage: %d, new dd_desc_len=%d\n", + numdescpage, dd->dd_desc_len); + } /* * Setup DMA descriptor area. @@ -2995,7 +3015,7 @@ ath_descdma_setup(struct ath_softc *sc, goto fail2; } - ds = dd->dd_desc; + ds = (uint8_t *) dd->dd_desc; DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %p (%lu)\n", __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len, (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len); @@ -3011,9 +3031,23 @@ ath_descdma_setup(struct ath_softc *sc, dd->dd_bufptr = bf; STAILQ_INIT(head); - for (i = 0; i < nbuf; i++, bf++, ds += ndesc) { - bf->bf_desc = ds; + for (i = 0; i < nbuf; i++, bf++, ds += (ndesc * desc_len)) { + bf->bf_desc = (struct ath_desc *) ds; bf->bf_daddr = DS2PHYS(dd, ds); + if (! ath_hal_split4ktrans(sc->sc_ah)) { + /* + * Merlin WAR: Skip descriptor addresses which + * cause 4KB boundary crossing along any point + * in the descriptor. + */ + if (ATH_DESC_4KB_BOUND_CHECK(bf->bf_daddr, + desc_len * ndesc)) { + /* Start at the next page */ + ds += 0x1000 - (bf->bf_daddr & 0xFFF); + bf->bf_desc = (struct ath_desc *) ds; + bf->bf_daddr = DS2PHYS(dd, ds); + } + } error = bus_dmamap_create(sc->sc_dmat, BUS_DMA_NOWAIT, &bf->bf_dmamap); if (error != 0) { @@ -3036,6 +3070,7 @@ fail0: memset(dd, 0, sizeof(*dd)); return error; #undef DS2PHYS +#undef ATH_DESC_4KB_BOUND_CHECK } static void From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 08:13:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A01B51065679; Sun, 31 Jul 2011 08:13:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90D1E8FC0A; Sun, 31 Jul 2011 08:13:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6V8DP7Z036096; Sun, 31 Jul 2011 08:13:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6V8DPQe036094; Sun, 31 Jul 2011 08:13:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107310813.p6V8DPQe036094@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 Jul 2011 08:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224542 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 08:13:25 -0000 Author: adrian Date: Sun Jul 31 08:13:25 2011 New Revision: 224542 URL: http://svn.freebsd.org/changeset/base/224542 Log: Remove two debugging printf()s which snuck in during the testing of the last commit. Approved by: re (kib) Pointy-hat-to: adrian@ Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jul 31 08:01:41 2011 (r224541) +++ head/sys/dev/ath/if_ath.c Sun Jul 31 08:13:25 2011 (r224542) @@ -2953,9 +2953,6 @@ ath_descdma_setup(struct ath_softc *sc, dd->dd_name = name; dd->dd_desc_len = desc_len * nbuf * ndesc; - device_printf(sc->sc_dev, "desc_len: %d, nbuf=%d, ndesc=%d; dd_desc_len=%d\n", - desc_len, nbuf, ndesc, dd->dd_desc_len); - /* * Merlin work-around: * Descriptors that cross the 4KB boundary can't be used. @@ -2964,8 +2961,6 @@ ath_descdma_setup(struct ath_softc *sc, if (! ath_hal_split4ktrans(sc->sc_ah)) { int numdescpage = 4096 / (desc_len * ndesc); dd->dd_desc_len = (nbuf / numdescpage + 1) * 4096; - device_printf(sc->sc_dev, "numdescpage: %d, new dd_desc_len=%d\n", - numdescpage, dd->dd_desc_len); } /* From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 13:49:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13C491065675; Sun, 31 Jul 2011 13:49:16 +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 036D38FC12; Sun, 31 Jul 2011 13:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VDnF9l048711; Sun, 31 Jul 2011 13:49:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VDnFC6048709; Sun, 31 Jul 2011 13:49:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201107311349.p6VDnFC6048709@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 31 Jul 2011 13:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224546 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 13:49:16 -0000 Author: glebius Date: Sun Jul 31 13:49:15 2011 New Revision: 224546 URL: http://svn.freebsd.org/changeset/base/224546 Log: Don't leak kld_sx lock in kldunloadf(). Approved by: re (kib) Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sun Jul 31 13:35:25 2011 (r224545) +++ head/sys/kern/kern_linker.c Sun Jul 31 13:49:15 2011 (r224546) @@ -1116,8 +1116,9 @@ kern_kldunload(struct thread *td, int fi PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); KLD_UNLOCK_READ(); } else -#else KLD_UNLOCK(); +#else + KLD_UNLOCK(); #endif CURVNET_RESTORE(); return (error); From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 15:23:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC619106564A; Sun, 31 Jul 2011 15:23:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBE528FC14; Sun, 31 Jul 2011 15:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VFNLaB051922; Sun, 31 Jul 2011 15:23:21 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VFNLPn051920; Sun, 31 Jul 2011 15:23:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107311523.p6VFNLPn051920@svn.freebsd.org> From: Glen Barber Date: Sun, 31 Jul 2011 15:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224548 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 15:23:21 -0000 Author: gjb (doc committer) Date: Sun Jul 31 15:23:21 2011 New Revision: 224548 URL: http://svn.freebsd.org/changeset/base/224548 Log: mdoc(7) fix for the pcm(4) manual Spotted by: manlint Approved by: re (kib) Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Sun Jul 31 14:38:25 2011 (r224547) +++ head/share/man/man4/pcm.4 Sun Jul 31 15:23:21 2011 (r224548) @@ -45,7 +45,8 @@ kernel configuration file: The .Nm driver is the main component of the -.Fx sound system. +.Fx +sound system. It works in conjunction with a bridge device driver on supported devices and provides PCM audio record and playback once it attaches. Each bridge device driver supports a specific set of audio chipsets and From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 16:16:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 758491065670; Sun, 31 Jul 2011 16:16:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64FFD8FC1D; Sun, 31 Jul 2011 16:16:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VGGPkU053911; Sun, 31 Jul 2011 16:16:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VGGPHI053909; Sun, 31 Jul 2011 16:16:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107311616.p6VGGPHI053909@svn.freebsd.org> From: Adrian Chadd Date: Sun, 31 Jul 2011 16:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224550 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 16:16:25 -0000 Author: adrian Date: Sun Jul 31 16:16:25 2011 New Revision: 224550 URL: http://svn.freebsd.org/changeset/base/224550 Log: Disable the RXORN/RXEOL interrupts if RXEOL occurs, preventing an interrupt storm. This is easily triggered by flipping on and off tcpdump -y IEEE802_11_RADIO w/ witness enabled. This causes a whole lot of console IO and when you're attached to a serial console (eg on my AR7161 embedded board), the RX interrupt doesn't get called quickly enough and the RX queue fills up. This wasn't a problem in the past because of the self-linked RX descriptor trick - the RX would never hit the "end" of the RX descriptor list. However this isn't possible for 802.11n (see previous commit history for why.) Both Linux ath9k and the Atheros reference driver code do this; I'm just looking now for where they then restart the PCU receive. Right now the RX will just stop until the interface is reset. Obtained from: Linux, Atheros Approved by: re (kib) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jul 31 16:08:29 2011 (r224549) +++ head/sys/dev/ath/if_ath.c Sun Jul 31 16:16:25 2011 (r224550) @@ -1395,6 +1395,12 @@ ath_intr(void *arg) * least on older hardware revs. */ sc->sc_stats.ast_rxeol++; + /* + * Disable RXEOL/RXORN - prevent an interrupt + * storm until the PCU logic can be reset. + */ + sc->sc_imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); + ath_hal_intrset(ah, sc->sc_imask); sc->sc_rxlink = NULL; } if (status & HAL_INT_TXURN) { From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 18:26:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 276E6106564A; Sun, 31 Jul 2011 18:26:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1735F8FC12; Sun, 31 Jul 2011 18:26:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VIQlIb058342; Sun, 31 Jul 2011 18:26:47 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VIQlFa058340; Sun, 31 Jul 2011 18:26:47 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201107311826.p6VIQlFa058340@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 31 Jul 2011 18:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224551 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 18:26:48 -0000 Author: marcel Date: Sun Jul 31 18:26:47 2011 New Revision: 224551 URL: http://svn.freebsd.org/changeset/base/224551 Log: Fix r224187: .word defines a 16-bit object and size_t is defined as a 32-bit intergal. Use .long to define sintrcnt and sintrname. Approved by: re (blanket) Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sun Jul 31 16:16:25 2011 (r224550) +++ head/sys/powerpc/booke/locore.S Sun Jul 31 18:26:47 2011 (r224551) @@ -790,12 +790,12 @@ GLOBAL(kernload) GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 GLOBAL(sintrnames) - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .long INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 GLOBAL(sintrcnt) - .word INTRCNT_COUNT * 4 * 2 + .long INTRCNT_COUNT * 4 * 2 #include From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 18:27:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01F8B106566C; Sun, 31 Jul 2011 18:27:59 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9C68FC16; Sun, 31 Jul 2011 18:27:58 +0000 (UTC) Received: by ywm39 with SMTP id 39so515268ywm.13 for ; Sun, 31 Jul 2011 11:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Lb6/lBb5myr4tAQ6DMz77j5TKPla8owCzsy2pRNiV+I=; b=St28PBz5Y3NXVx8TlJkkA2OynHdOMx5Bg1+F+kaxc3Ta0W5rFawAdT+UtuS6dBqEBz 6vOP1ROrB+IhqSQvdzedYOTdH24f8+3OZpF91BsPZ/RGG09E9di5Y0T2lrw00KXxGiEG 0Ei/QGQzrI3D0MZzk+pkAeaGW8mz54WBHanxw= MIME-Version: 1.0 Received: by 10.236.165.72 with SMTP id d48mr1414957yhl.26.1312136876538; Sun, 31 Jul 2011 11:27:56 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.109.13 with HTTP; Sun, 31 Jul 2011 11:27:56 -0700 (PDT) In-Reply-To: <201107311826.p6VIQlFa058340@svn.freebsd.org> References: <201107311826.p6VIQlFa058340@svn.freebsd.org> Date: Sun, 31 Jul 2011 20:27:56 +0200 X-Google-Sender-Auth: XO1KrPg6Y0cwO-0nT2QSxKxciFE Message-ID: From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224551 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 18:27:59 -0000 I actually submitted a better fix which does use .int. I wasn't sure BETA1 was out, so I'm going to send a formal request now. Attilio 2011/7/31 Marcel Moolenaar : > Author: marcel > Date: Sun Jul 31 18:26:47 2011 > New Revision: 224551 > URL: http://svn.freebsd.org/changeset/base/224551 > > Log: > =C2=A0Fix r224187: .word defines a 16-bit object and size_t is defined as > =C2=A0a 32-bit intergal. Use .long to define sintrcnt and sintrname. > > =C2=A0Approved by: =C2=A0re (blanket) > > Modified: > =C2=A0head/sys/powerpc/booke/locore.S > > Modified: head/sys/powerpc/booke/locore.S > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/powerpc/booke/locore.S =C2=A0 =C2=A0 Sun Jul 31 16:16:25 201= 1 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r224550) > +++ head/sys/powerpc/booke/locore.S =C2=A0 =C2=A0 Sun Jul 31 18:26:47 201= 1 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r224551) > @@ -790,12 +790,12 @@ GLOBAL(kernload) > =C2=A0GLOBAL(intrnames) > =C2=A0 =C2=A0 =C2=A0 =C2=A0.space =C2=A0INTRCNT_COUNT * (MAXCOMLEN + 1) *= 2 > =C2=A0GLOBAL(sintrnames) > - =C2=A0 =C2=A0 =C2=A0 .word =C2=A0 INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > + =C2=A0 =C2=A0 =C2=A0 .long =C2=A0 INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0.align 4 > =C2=A0GLOBAL(intrcnt) > =C2=A0 =C2=A0 =C2=A0 =C2=A0.space =C2=A0INTRCNT_COUNT * 4 * 2 > =C2=A0GLOBAL(sintrcnt) > - =C2=A0 =C2=A0 =C2=A0 .word =C2=A0 INTRCNT_COUNT * 4 * 2 > + =C2=A0 =C2=A0 =C2=A0 .long =C2=A0 INTRCNT_COUNT * 4 * 2 > > =C2=A0#include > --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 18:30:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACD62106566C; Sun, 31 Jul 2011 18:30:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9A98FC14; Sun, 31 Jul 2011 18:30:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VIUclI058509; Sun, 31 Jul 2011 18:30:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VIUc1V058507; Sun, 31 Jul 2011 18:30:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201107311830.p6VIUc1V058507@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 31 Jul 2011 18:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224552 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 18:30:38 -0000 Author: marcel Date: Sun Jul 31 18:30:38 2011 New Revision: 224552 URL: http://svn.freebsd.org/changeset/base/224552 Log: Fix r222813: we need to include sys/cpuset.h. because the PIC interface uses cpuset_t. While here, fix the redundant inclusion of sys/bus.h and order the includes. Approved by: re (blanket) Modified: head/sys/powerpc/mpc85xx/atpic.c Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Sun Jul 31 18:26:47 2011 (r224551) +++ head/sys/powerpc/mpc85xx/atpic.c Sun Jul 31 18:30:38 2011 (r224552) @@ -28,11 +28,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include -#include #include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 18:34:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B29106564A; Sun, 31 Jul 2011 18:34:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 749AE8FC16; Sun, 31 Jul 2011 18:34:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VIYcRM058703; Sun, 31 Jul 2011 18:34:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VIYcW9058701; Sun, 31 Jul 2011 18:34:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201107311834.p6VIYcW9058701@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 31 Jul 2011 18:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224553 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 18:34:38 -0000 Author: marcel Date: Sun Jul 31 18:34:38 2011 New Revision: 224553 URL: http://svn.freebsd.org/changeset/base/224553 Log: Apply r221124 to Book-E: switch to the new NFS client. Approved by: re (blanket) Modified: head/sys/powerpc/conf/MPC85XX Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Jul 31 18:30:38 2011 (r224552) +++ head/sys/powerpc/conf/MPC85XX Sun Jul 31 18:34:38 2011 (r224553) @@ -43,7 +43,7 @@ options MD_ROOT options MPC85XX options MSDOSFS options NFS_ROOT -options NFSCLIENT +options NFSCL options NFSLOCKD options PROCFS options PSEUDOFS From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 18:43:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9764106566C; Sun, 31 Jul 2011 18:43:03 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id B64748FC14; Sun, 31 Jul 2011 18:43:03 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p6VIgufD013156 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 31 Jul 2011 11:43:03 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Sun, 31 Jul 2011 11:43:05 -0700 Content-Transfer-Encoding: 7bit Message-Id: <6C5FFE5F-7BF6-4347-8442-8DE0F4E13D2E@xcllnt.net> References: <201107311826.p6VIQlFa058340@svn.freebsd.org> To: Attilio Rao X-Mailer: Apple Mail (2.1244.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r224551 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 18:43:04 -0000 On Jul 31, 2011, at 11:27 AM, Attilio Rao wrote: > I actually submitted a better fix which does use .int. > I wasn't sure BETA1 was out, so I'm going to send a formal request now. Maybe we should just let it be. I don't see anything superior with using .int that .long didn't already fix. If anything, we could end up breaking stuff and then having to fix it again. Any reason to go back in and change it again that I can't see? -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 18:59:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84924106566B; Sun, 31 Jul 2011 18:59:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 05BBD8FC19; Sun, 31 Jul 2011 18:59:39 +0000 (UTC) Received: by gwb15 with SMTP id 15so4222216gwb.13 for ; Sun, 31 Jul 2011 11:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=swMFgGff8N5t0F2Egf9fDDtXLQJrPr1ZD1Uc2wS9C38=; b=jB6VhHSe0aIOEkmEEBfs4FXMFCMKHq31HV1Io1u8N4Qyt1mXxipQ03+hsSUuyaPwxN cM8Fh3po1059ZPWmbISh3J+UFCpVPq9uRH0KotpBw3jYTJ+TfMDjFiRJlHfCKuNSYX2B XIxvFaunVn7ytqlFGIRW5LaNCqpBABEzIYQIo= MIME-Version: 1.0 Received: by 10.236.186.7 with SMTP id v7mr2396225yhm.294.1312138779154; Sun, 31 Jul 2011 11:59:39 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.109.13 with HTTP; Sun, 31 Jul 2011 11:59:39 -0700 (PDT) In-Reply-To: <6C5FFE5F-7BF6-4347-8442-8DE0F4E13D2E@xcllnt.net> References: <201107311826.p6VIQlFa058340@svn.freebsd.org> <6C5FFE5F-7BF6-4347-8442-8DE0F4E13D2E@xcllnt.net> Date: Sun, 31 Jul 2011 14:59:39 -0400 X-Google-Sender-Auth: mPGZ8zAsohHizqgBBnQHdzzDZmU Message-ID: From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r224551 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 18:59:40 -0000 2011/7/31 Marcel Moolenaar : > > On Jul 31, 2011, at 11:27 AM, Attilio Rao wrote: > >> I actually submitted a better fix which does use .int. >> I wasn't sure BETA1 was out, so I'm going to send a formal request now. > > Maybe we should just let it be. I don't see anything > superior with using .int that .long didn't already > fix. If anything, we could end up breaking stuff and > then having to fix it again. > > Any reason to go back in and change it again that I > can't see? Besides extending the fix to arm and mips, size_t is typedefed as int and not as long, thus I think it is more correct semantically. Pratically speaking, for booke, it doesn't change anything though. As you have the blanket on powerpc I'll do what you prefer for it, the patch is here: http://www.freebsd.org/~attilio/sintrcnt-fixup32.diff Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 20:06:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA969106573A; Sun, 31 Jul 2011 20:06:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FD748FC08; Sun, 31 Jul 2011 20:06:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VK6Cm7061549; Sun, 31 Jul 2011 20:06:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VK6Cuq061547; Sun, 31 Jul 2011 20:06:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107312006.p6VK6Cuq061547@svn.freebsd.org> From: Rick Macklem Date: Sun, 31 Jul 2011 20:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224554 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 20:06:12 -0000 Author: rmacklem Date: Sun Jul 31 20:06:11 2011 New Revision: 224554 URL: http://svn.freebsd.org/changeset/base/224554 Log: Fix rename in the new NFS server so that it does not require a recursive vnode lock on the directory for the case where the new file name is in the same directory as the old one. The patch handles this as a special case, recognized by the new directory having the same file handle as the old one and just VREF()s the old dir vnode for this case, instead of doing a second VFS_FHTOVP() to get it. This is required so that the server will work for file systems like msdosfs, that do not support recursive vnode locking. This problem was discovered during recent testing by pho@ when exporting an msdosfs file system via the new NFS server. Tested by: pho Reviewed by: zkirsch Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jul 31 18:34:38 2011 (r224553) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jul 31 20:06:11 2011 (r224554) @@ -1425,6 +1425,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, struct nfsrvfh tfh; char *bufp, *tbufp = NULL; u_long *hashp; + fhandle_t fh; if (nd->nd_repstat) { nfsrv_wcc(nd, fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft); @@ -1450,19 +1451,34 @@ nfsrvd_rename(struct nfsrv_descript *nd, tnes = *toexp; tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 0); } else { + tfh.nfsrvfh_len = 0; error = nfsrv_mtofh(nd, &tfh); + if (error == 0) + error = nfsvno_getfh(dp, &fh, p); if (error) { vput(dp); /* todp is always NULL except NFSv4 */ nfsvno_relpathbuf(&fromnd); goto out; } - nd->nd_cred->cr_uid = nd->nd_saveduid; - nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, 0, p); - if (tdp) { + + /* If this is the same file handle, just VREF() the vnode. */ + if (tfh.nfsrvfh_len == NFSX_MYFH && + !NFSBCMP(tfh.nfsrvfh_data, &fh, NFSX_MYFH)) { + VREF(dp); + tdp = dp; + tnes = *exp; tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); - NFSVOPUNLOCK(tdp, 0); + } else { + nd->nd_cred->cr_uid = nd->nd_saveduid; + nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, + 0, p); + if (tdp) { + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, + nd->nd_cred, p, 1); + NFSVOPUNLOCK(tdp, 0); + } } } NFSNAMEICNDSET(&tond.ni_cnd, nd->nd_cred, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART); From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 21:04:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 830BA1065670; Sun, 31 Jul 2011 21:04:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 733278FC12; Sun, 31 Jul 2011 21:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6VL4lPD063320; Sun, 31 Jul 2011 21:04:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6VL4l8f063318; Sun, 31 Jul 2011 21:04:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107312104.p6VL4l8f063318@svn.freebsd.org> From: Glen Barber Date: Sun, 31 Jul 2011 21:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224555 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 21:04:47 -0000 Author: gjb (doc committer) Date: Sun Jul 31 21:04:47 2011 New Revision: 224555 URL: http://svn.freebsd.org/changeset/base/224555 Log: Update vfs_getopt(9) to reflect 32-bit to 64-bit change from r224290. PR: 159324 Submitted by: Brandon Gooch (jamesbrandongooch % gmail ! com) Approved by: re (kib) Modified: head/share/man/man9/vfs_getopt.9 Modified: head/share/man/man9/vfs_getopt.9 ============================================================================== --- head/share/man/man9/vfs_getopt.9 Sun Jul 31 20:06:11 2011 (r224554) +++ head/share/man/man9/vfs_getopt.9 Sun Jul 31 21:04:47 2011 (r224555) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2009 +.Dd July 31, 2011 .Dt VFS_GETOPT 9 .Os .Sh NAME @@ -51,7 +51,7 @@ .Fn vfs_getops "struct vfsoptlist *opts" "const char *name" "int *error" .Ft int .Fo vfs_flagopt -.Fa "struct vfsoptlist *opts" "const char *name" "u_int *flags" "u_int flag" +.Fa "struct vfsoptlist *opts" "const char *name" "uint64_t *flags" "uint64_t flag" .Fc .Ft int .Fo vfs_scanopt From owner-svn-src-head@FreeBSD.ORG Sun Jul 31 23:36:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id B38F81065670; Sun, 31 Jul 2011 23:36:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 7549F151638; Sun, 31 Jul 2011 23:36:29 +0000 (UTC) Message-ID: <4E35E6FB.5040409@FreeBSD.org> Date: Sun, 31 Jul 2011 16:36:27 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:5.0) Gecko/20110723 Thunderbird/5.0 MIME-Version: 1.0 To: Glen Barber References: <201107232255.p6NMtWNp080295@svn.freebsd.org> In-Reply-To: <201107232255.p6NMtWNp080295@svn.freebsd.org> X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224284 - in head: share/man/man4 share/man/man5 share/man/man8 usr.sbin/faithd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2011 23:36:31 -0000 On 07/23/2011 15:55, Glen Barber wrote: > +.%U http://www.ietf.org/rfc/rfc2893.txt References to IETF documents in our documentation should use the tools.ietf.org site. It gives a much nicer experience, including working HTML tags, etc. For instance, the link for this page should be: http://tools.ietf.org/html/rfc2893 -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 03:13:01 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B216A1065670; Mon, 1 Aug 2011 03:13:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id CE87A8FC0A; Mon, 1 Aug 2011 03:13:00 +0000 (UTC) Received: from alph.allbsd.org (p3028-ipbf608funabasi.chiba.ocn.ne.jp [125.175.94.28]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id p713CbYq056570; Mon, 1 Aug 2011 12:12:48 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id p713CbxA051115; Mon, 1 Aug 2011 12:12:37 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 01 Aug 2011 12:12:33 +0900 (JST) Message-Id: <20110801.121233.1052535658641629145.hrs@allbsd.org> To: joel@FreeBSD.org, doc@FreeBSD.org From: Hiroki Sato In-Reply-To: <201107302309.p6UN9rhJ019321@svn.freebsd.org> References: <201107302309.p6UN9rhJ019321@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Aug__1_12_12_33_2011_214)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Mon, 01 Aug 2011 12:12:54 +0900 (JST) X-Spam-Status: No, score=-102.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT,DIRECTOCNDYN,RCVD_IN_RP_RNBL,SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224533 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 03:13:01 -0000 ----Security_Multipart(Mon_Aug__1_12_12_33_2011_214)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Joel, Joel Dahl wrote in <201107302309.p6UN9rhJ019321@svn.freebsd.org>: jo> Author: joel (doc committer) jo> Date: Sat Jul 30 23:09:52 2011 jo> New Revision: 224533 jo> URL: http://svn.freebsd.org/changeset/base/224533 jo> jo> Log: jo> Add a better description, a few examples and a couple of minor fixes. jo> jo> Reviewed by: brueffer jo> Approved by: re (kib) jo> jo> Modified: jo> head/share/man/man4/pcm.4 jo> jo> Modified: head/share/man/man4/pcm.4 jo> ============================================================================== (snip) jo> @@ -173,7 +244,7 @@ controls (bass and treble). jo> Commonly used for ear-candy or frequency compensation due to the vast jo> difference in hardware quality. jo> EQ is disabled by default, but can be enabled with the jo> -.Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq jo> +.Va hint.pcm.%d.eq : jo> -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq jo> +.It Va hint.pcm.%d.eq : jo> -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .vpc jo> +.It Va hint.pcm.%d.vpc I know several manual pages are also using this expression (%d) for replaceables, but I am wondering if this is friendly for average users. Is ".Ar N" for an integer problematic, for example? I would like comments since other documents in DocBook have used such a notation for a long time and I feel we need consistency with them. -- Hiroki ----Security_Multipart(Mon_Aug__1_12_12_33_2011_214)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk42GaEACgkQTyzT2CeTzy1aOACdEicwXqLiGuqyriknLy7OQRyu 9wAAoI48fVD8jIb4Wd75dvL0j6MOovN9 =hKoA -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Aug__1_12_12_33_2011_214)---- From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 08:22:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E182D1065670; Mon, 1 Aug 2011 08:22:40 +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 D210A8FC18; Mon, 1 Aug 2011 08:22:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p718MekL084707; Mon, 1 Aug 2011 08:22:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p718Meeg084704; Mon, 1 Aug 2011 08:22:40 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108010822.p718Meeg084704@svn.freebsd.org> From: Martin Matuska Date: Mon, 1 Aug 2011 08:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224566 - in head/usr.bin: cpio tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 08:22:41 -0000 Author: mm Date: Mon Aug 1 08:22:40 2011 New Revision: 224566 URL: http://svn.freebsd.org/changeset/base/224566 Log: Correctly link bsdcpio and bsdtar against libmd and libcrpyto by applying the change from r221472 (libarchive). Reviewed by: kientzle Approved by: re (kib) MFC after: 3 days Modified: head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Mon Aug 1 08:17:54 2011 (r224565) +++ head/usr.bin/cpio/Makefile Mon Aug 1 08:22:40 2011 (r224566) @@ -19,11 +19,14 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../.. # statically linked, cannot use -lcrypto, and are size sensitive. CFLAGS+= -DSMALLER .endif -DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} ${LIBLZMA} ${LIBBSDXML} -LDADD= -larchive -lz -lbz2 -lmd -llzma -lbsdxml +DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBLZMA} ${LIBBSDXML} +LDADD= -larchive -lz -lbz2 -llzma -lbsdxml .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto +.else +DPADD+= ${LIBMD} +LDADD+= -lmd .endif SYMLINKS=bsdcpio ${BINDIR}/cpio Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Mon Aug 1 08:17:54 2011 (r224565) +++ head/usr.bin/tar/Makefile Mon Aug 1 08:22:40 2011 (r224566) @@ -18,12 +18,16 @@ SRCS+= err.c \ matching.c \ pathmatch.c -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBLZMA} ${LIBBSDXML} -LDADD= -larchive -lbz2 -lz -lmd -llzma -lbsdxml +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} ${LIBBSDXML} +LDADD= -larchive -lbz2 -lz -llzma -lbsdxml .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto +.else +DPADD+= ${LIBMD} +LDADD+= -lmd .endif + CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../lib/libarchive From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 08:52:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D16A4106564A; Mon, 1 Aug 2011 08:52:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23AA8FC2B; Mon, 1 Aug 2011 08:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p718q5h4085633; Mon, 1 Aug 2011 08:52:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p718q5fP085631; Mon, 1 Aug 2011 08:52:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108010852.p718q5fP085631@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 1 Aug 2011 08:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224568 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 08:52:05 -0000 Author: kib Date: Mon Aug 1 08:52:05 2011 New Revision: 224568 URL: http://svn.freebsd.org/changeset/base/224568 Log: Fix markup. Approved by: re (hrs) Modified: head/share/man/man9/taskqueue.9 Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Mon Aug 1 08:34:00 2011 (r224567) +++ head/share/man/man9/taskqueue.9 Mon Aug 1 08:52:05 2011 (r224568) @@ -188,7 +188,8 @@ The count is cleared, and the old value returned in the reference parameter .Fa pendp , -if it is non- Dv NULL . +if it is non- +.Dv NULL . If the task is currently running, .Dv EBUSY is returned, otherwise 0. From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 09:43:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDB10106564A; Mon, 1 Aug 2011 09:43:35 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACD3A8FC19; Mon, 1 Aug 2011 09:43:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p719hZru087186; Mon, 1 Aug 2011 09:43:35 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p719hZuS087179; Mon, 1 Aug 2011 09:43:35 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201108010943.p719hZuS087179@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 1 Aug 2011 09:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224569 - head/lib/libmemstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 09:43:35 -0000 Author: pluknet Date: Mon Aug 1 09:43:35 2011 New Revision: 224569 URL: http://svn.freebsd.org/changeset/base/224569 Log: Get rid of MAXCPU knowledge used for internal needs only. Switch to dynamic memory allocation to hold per-CPU memory types data (sized to mp_maxid for UMA, and to mp_maxcpus for malloc to match the kernel). That fixes libmemstat with arbitrary large MAXCPU values and therefore eliminates MEMSTAT_ERROR_TOOMANYCPUS error type. Reviewed by: jhb Approved by: re (kib) Modified: head/lib/libmemstat/libmemstat.3 head/lib/libmemstat/memstat.c head/lib/libmemstat/memstat.h head/lib/libmemstat/memstat_internal.h head/lib/libmemstat/memstat_malloc.c head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/libmemstat.3 ============================================================================== --- head/lib/libmemstat/libmemstat.3 Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/libmemstat.3 Mon Aug 1 09:43:35 2011 (r224569) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2005 +.Dd July 21, 2011 .Dt LIBMEMSTAT 3 .Os .Sh NAME @@ -412,10 +412,6 @@ values of .Er EACCES or .Er EPERM . -.It Dv MEMSTAT_ERROR_TOOMANYCPUS -Returned if the compile-time limit on the number of CPUs in -.Nm -is lower than the number of CPUs returned by a statistics data source. .It Dv MEMSTAT_ERROR_DATAERROR Returned if .Nm Modified: head/lib/libmemstat/memstat.c ============================================================================== --- head/lib/libmemstat/memstat.c Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat.c Mon Aug 1 09:43:35 2011 (r224569) @@ -49,8 +49,6 @@ memstat_strerror(int error) return ("Version mismatch"); case MEMSTAT_ERROR_PERMISSION: return ("Permission denied"); - case MEMSTAT_ERROR_TOOMANYCPUS: - return ("Too many CPUs"); case MEMSTAT_ERROR_DATAERROR: return ("Data format error"); case MEMSTAT_ERROR_KVM: @@ -99,6 +97,8 @@ _memstat_mtl_empty(struct memory_type_li struct memory_type *mtp; while ((mtp = LIST_FIRST(&list->mtl_list))) { + free(mtp->mt_percpu_alloc); + free(mtp->mt_percpu_cache); LIST_REMOVE(mtp, mt_list); free(mtp); } @@ -147,7 +147,7 @@ memstat_mtl_find(struct memory_type_list */ struct memory_type * _memstat_mt_allocate(struct memory_type_list *list, int allocator, - const char *name) + const char *name, int maxcpus) { struct memory_type *mtp; @@ -158,6 +158,10 @@ _memstat_mt_allocate(struct memory_type_ bzero(mtp, sizeof(*mtp)); mtp->mt_allocator = allocator; + mtp->mt_percpu_alloc = malloc(sizeof(struct mt_percpu_alloc_s) * + maxcpus); + mtp->mt_percpu_cache = malloc(sizeof(struct mt_percpu_cache_s) * + maxcpus); strlcpy(mtp->mt_name, name, MEMTYPE_MAXNAME); LIST_INSERT_HEAD(&list->mtl_list, mtp, mt_list); return (mtp); @@ -171,7 +175,7 @@ _memstat_mt_allocate(struct memory_type_ * libmemstat(3) internal function. */ void -_memstat_mt_reset_stats(struct memory_type *mtp) +_memstat_mt_reset_stats(struct memory_type *mtp, int maxcpus) { int i; @@ -193,7 +197,7 @@ _memstat_mt_reset_stats(struct memory_ty mtp->mt_zonefree = 0; mtp->mt_kegfree = 0; - for (i = 0; i < MEMSTAT_MAXCPU; i++) { + for (i = 0; i < maxcpus; i++) { mtp->mt_percpu_alloc[i].mtp_memalloced = 0; mtp->mt_percpu_alloc[i].mtp_memfreed = 0; mtp->mt_percpu_alloc[i].mtp_numallocs = 0; Modified: head/lib/libmemstat/memstat.h ============================================================================== --- head/lib/libmemstat/memstat.h Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat.h Mon Aug 1 09:43:35 2011 (r224569) @@ -30,12 +30,6 @@ #define _MEMSTAT_H_ /* - * Number of CPU slots in library-internal data structures. This should be - * at least the value of MAXCPU from param.h. - */ -#define MEMSTAT_MAXCPU 32 - -/* * Amount of caller data to maintain for each caller data slot. Applications * must not request more than this number of caller save data, or risk * corrupting internal libmemstat(3) data structures. A compile time check @@ -70,7 +64,6 @@ #define MEMSTAT_ERROR_NOMEMORY 1 /* Out of memory. */ #define MEMSTAT_ERROR_VERSION 2 /* Unsupported version. */ #define MEMSTAT_ERROR_PERMISSION 3 /* Permission denied. */ -#define MEMSTAT_ERROR_TOOMANYCPUS 4 /* Too many CPUs. */ #define MEMSTAT_ERROR_DATAERROR 5 /* Error in stat data. */ #define MEMSTAT_ERROR_KVM 6 /* See kvm_geterr() for err. */ #define MEMSTAT_ERROR_KVM_NOSYMBOL 7 /* Symbol not available. */ Modified: head/lib/libmemstat/memstat_internal.h ============================================================================== --- head/lib/libmemstat/memstat_internal.h Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat_internal.h Mon Aug 1 09:43:35 2011 (r224569) @@ -92,7 +92,7 @@ struct memory_type { * Per-CPU measurements fall into two categories: per-CPU allocation, * and per-CPU cache state. */ - struct { + struct mt_percpu_alloc_s { uint64_t mtp_memalloced;/* Per-CPU mt_memalloced. */ uint64_t mtp_memfreed; /* Per-CPU mt_memfreed. */ uint64_t mtp_numallocs; /* Per-CPU mt_numallocs. */ @@ -100,11 +100,11 @@ struct memory_type { uint64_t mtp_sizemask; /* Per-CPU mt_sizemask. */ void *mtp_caller_pointer[MEMSTAT_MAXCALLER]; uint64_t mtp_caller_uint64[MEMSTAT_MAXCALLER]; - } mt_percpu_alloc[MEMSTAT_MAXCPU]; + } *mt_percpu_alloc; - struct { + struct mt_percpu_cache_s { uint64_t mtp_free; /* Per-CPU cache free items. */ - } mt_percpu_cache[MEMSTAT_MAXCPU]; + } *mt_percpu_cache; LIST_ENTRY(memory_type) mt_list; /* List of types. */ }; @@ -119,7 +119,8 @@ struct memory_type_list { void _memstat_mtl_empty(struct memory_type_list *list); struct memory_type *_memstat_mt_allocate(struct memory_type_list *list, - int allocator, const char *name); -void _memstat_mt_reset_stats(struct memory_type *mtp); + int allocator, const char *name, int maxcpus); +void _memstat_mt_reset_stats(struct memory_type *mtp, + int maxcpus); #endif /* !_MEMSTAT_INTERNAL_H_ */ Modified: head/lib/libmemstat/memstat_malloc.c ============================================================================== --- head/lib/libmemstat/memstat_malloc.c Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat_malloc.c Mon Aug 1 09:43:35 2011 (r224569) @@ -96,11 +96,6 @@ retry: return (-1); } - if (maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - return (-1); - } - size = sizeof(count); if (sysctlbyname("kern.malloc_count", &count, &size, NULL, 0) < 0) { if (errno == EACCES || errno == EPERM) @@ -160,12 +155,6 @@ retry: return (-1); } - if (mtshp->mtsh_maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - free(buffer); - return (-1); - } - /* * For the remainder of this function, we are quite trusting about * the layout of structures and sizes, since we've determined we have @@ -184,7 +173,7 @@ retry: mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_MALLOC, - mthp->mth_name); + mthp->mth_name, maxcpus); if (mtp == NULL) { _memstat_mtl_empty(list); free(buffer); @@ -195,7 +184,7 @@ retry: /* * Reset the statistics on a current node. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, maxcpus); for (j = 0; j < maxcpus; j++) { mtsp = (struct malloc_type_stats *)p; @@ -295,7 +284,7 @@ memstat_kvm_malloc(struct memory_type_li void *kmemstatistics; int hint_dontsearch, j, mp_maxcpus, ret; char name[MEMTYPE_MAXNAME]; - struct malloc_type_stats mts[MEMSTAT_MAXCPU], *mtsp; + struct malloc_type_stats *mts, *mtsp; struct malloc_type_internal *mtip; struct malloc_type type, *typep; kvm_t *kvm; @@ -322,11 +311,6 @@ memstat_kvm_malloc(struct memory_type_li return (-1); } - if (mp_maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - return (-1); - } - ret = kread_symbol(kvm, X_KMEMSTATISTICS, &kmemstatistics, sizeof(kmemstatistics), 0); if (ret != 0) { @@ -334,10 +318,17 @@ memstat_kvm_malloc(struct memory_type_li return (-1); } + mts = malloc(sizeof(struct malloc_type_stats) * mp_maxcpus); + if (mts == NULL) { + list->mtl_error = MEMSTAT_ERROR_NOMEMORY; + return (-1); + } + for (typep = kmemstatistics; typep != NULL; typep = type.ks_next) { ret = kread(kvm, typep, &type, sizeof(type), 0); if (ret != 0) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = ret; return (-1); } @@ -345,6 +336,7 @@ memstat_kvm_malloc(struct memory_type_li MEMTYPE_MAXNAME); if (ret != 0) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = ret; return (-1); } @@ -358,6 +350,7 @@ memstat_kvm_malloc(struct memory_type_li sizeof(struct malloc_type_stats), 0); if (ret != 0) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = ret; return (-1); } @@ -368,9 +361,10 @@ memstat_kvm_malloc(struct memory_type_li mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_MALLOC, - name); + name, mp_maxcpus); if (mtp == NULL) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = MEMSTAT_ERROR_NOMEMORY; return (-1); } @@ -379,7 +373,7 @@ memstat_kvm_malloc(struct memory_type_li * This logic is replicated from kern_malloc.c, and should * be kept in sync. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, mp_maxcpus); for (j = 0; j < mp_maxcpus; j++) { mtsp = &mts[j]; mtp->mt_memalloced += mtsp->mts_memalloced; Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat_uma.c Mon Aug 1 09:43:35 2011 (r224569) @@ -79,7 +79,7 @@ memstat_sysctl_uma(struct memory_type_li struct uma_type_header *uthp; struct uma_percpu_stat *upsp; struct memory_type *mtp; - int count, hint_dontsearch, i, j, maxcpus; + int count, hint_dontsearch, i, j, maxcpus, maxid; char *buffer, *p; size_t size; @@ -93,24 +93,19 @@ memstat_sysctl_uma(struct memory_type_li * from the header. */ retry: - size = sizeof(maxcpus); - if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &size, NULL, 0) < 0) { + size = sizeof(maxid); + if (sysctlbyname("kern.smp.maxid", &maxid, &size, NULL, 0) < 0) { if (errno == EACCES || errno == EPERM) list->mtl_error = MEMSTAT_ERROR_PERMISSION; else list->mtl_error = MEMSTAT_ERROR_DATAERROR; return (-1); } - if (size != sizeof(maxcpus)) { + if (size != sizeof(maxid)) { list->mtl_error = MEMSTAT_ERROR_DATAERROR; return (-1); } - if (maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - return (-1); - } - size = sizeof(count); if (sysctlbyname("vm.zone_count", &count, &size, NULL, 0) < 0) { if (errno == EACCES || errno == EPERM) @@ -125,7 +120,7 @@ retry: } size = sizeof(*uthp) + count * (sizeof(*uthp) + sizeof(*upsp) * - maxcpus); + (maxid + 1)); buffer = malloc(size); if (buffer == NULL) { @@ -170,12 +165,6 @@ retry: return (-1); } - if (ushp->ush_maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - free(buffer); - return (-1); - } - /* * For the remainder of this function, we are quite trusting about * the layout of structures and sizes, since we've determined we have @@ -194,7 +183,7 @@ retry: mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_UMA, - uthp->uth_name); + uthp->uth_name, maxid + 1); if (mtp == NULL) { _memstat_mtl_empty(list); free(buffer); @@ -205,7 +194,7 @@ retry: /* * Reset the statistics on a current node. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, maxid + 1); mtp->mt_numallocs = uthp->uth_allocs; mtp->mt_numfrees = uthp->uth_frees; @@ -398,7 +387,7 @@ memstat_kvm_uma(struct memory_type_list mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_UMA, - name); + name, mp_maxid + 1); if (mtp == NULL) { free(ucp_array); _memstat_mtl_empty(list); @@ -408,7 +397,7 @@ memstat_kvm_uma(struct memory_type_list /* * Reset the statistics on a current node. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, mp_maxid + 1); mtp->mt_numallocs = uz.uz_allocs; mtp->mt_numfrees = uz.uz_frees; mtp->mt_failures = uz.uz_fails; From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 11:24:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B552B1065670; Mon, 1 Aug 2011 11:24:55 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A56F78FC12; Mon, 1 Aug 2011 11:24:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71BOtkB094570; Mon, 1 Aug 2011 11:24:55 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71BOt3Q094568; Mon, 1 Aug 2011 11:24:55 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201108011124.p71BOt3Q094568@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 1 Aug 2011 11:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224571 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 11:24:55 -0000 Author: pluknet Date: Mon Aug 1 11:24:55 2011 New Revision: 224571 URL: http://svn.freebsd.org/changeset/base/224571 Log: Add missing MODULE_VERSION() definition to protect against duplicating module loads. PR: kern/159345 Reported by: Eugene Grosbein Tested by: Eugene Grosbein Approved by: re (kib) MFC after: 1 week Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Aug 1 10:57:54 2011 (r224570) +++ head/sys/net/if_lagg.c Mon Aug 1 11:24:55 2011 (r224571) @@ -208,6 +208,7 @@ static moduledata_t lagg_mod = { }; DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_lagg, 1); #if __FreeBSD_version >= 800000 /* From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 12:52:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265B51065679 for ; Mon, 1 Aug 2011 12:52:01 +0000 (UTC) (envelope-from gjb@onyx.glenbarber.us) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id CA1D78FC23 for ; Mon, 1 Aug 2011 12:52:00 +0000 (UTC) Received: (qmail 81146 invoked by uid 1001); 1 Aug 2011 08:25:18 -0400 Date: Mon, 1 Aug 2011 08:25:18 -0400 From: Glen Barber To: Doug Barton Message-ID: <20110801122518.GA81095@onyx.glenbarber.us> References: <201107232255.p6NMtWNp080295@svn.freebsd.org> <4E35E6FB.5040409@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <4E35E6FB.5040409@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224284 - in head: share/man/man4 share/man/man5 share/man/man8 usr.sbin/faithd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 12:52:01 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Doug Barton wrote:=20 > On 07/23/2011 15:55, Glen Barber wrote: > > +.%U http://www.ietf.org/rfc/rfc2893.txt >=20 > References to IETF documents in our documentation should use the > tools.ietf.org site. It gives a much nicer experience, including working > HTML tags, etc. For instance, the link for this page should be: >=20 > http://tools.ietf.org/html/rfc2893 >=20 Thanks, Doug. I'll fix this later today. --=20 Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAABCAAGBQJONpsuAAoJEFJPDDeguUajbmIIAJt8Dx4EEWvu7XxyqL2Nto1g ixAL8i967QGYmmxOm+PHeRyO1oDouZPXt4jQtlM4brP2tbcNQsJw4KhEWOpJ3JGq IeU/fT/6t6X274jaZ6LecZWm9xoMy/sMPeI27XysbqymMplqFpKbkS46DxdnKCyB My2ooZTQuJhgNfUiy35Y7WGjMLUXrvF8FyjH7rP6eykK7pRKh8o5/8u36drEI+YP RkBQ5btqvnwn3eGADjtSJ5pJz+BnFqd25ObNP0ay80K/MX2BuouyGR/0d3ILvqsl gR7WmyTlraArRbzPd+7myxsaT0FLRLbJw1Er73DYeAWAA+qAHOA1ZCbtXvakXao= =580P -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X-- From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 13:41:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1596A1065672; Mon, 1 Aug 2011 13:41:39 +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 056468FC0C; Mon, 1 Aug 2011 13:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71DfcXt099209; Mon, 1 Aug 2011 13:41:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71DfcFs099207; Mon, 1 Aug 2011 13:41:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201108011341.p71DfcFs099207@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 1 Aug 2011 13:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224575 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 13:41:39 -0000 Author: glebius Date: Mon Aug 1 13:41:38 2011 New Revision: 224575 URL: http://svn.freebsd.org/changeset/base/224575 Log: Add missing break; in r223593. Submitted by: sem Pointy hat to: glebius Approved by: re (kib) Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon Aug 1 13:40:48 2011 (r224574) +++ head/sys/netinet/ip_divert.c Mon Aug 1 13:41:38 2011 (r224575) @@ -410,6 +410,7 @@ div_output(struct socket *so, struct mbu } ip6->ip6_plen = ntohs(ip6->ip6_plen); + break; } #endif default: From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 14:50:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF714106564A; Mon, 1 Aug 2011 14:50:31 +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 AF20F8FC12; Mon, 1 Aug 2011 14:50:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71EoV30001524; Mon, 1 Aug 2011 14:50:31 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71EoVn0001522; Mon, 1 Aug 2011 14:50:31 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108011450.p71EoVn0001522@svn.freebsd.org> From: Martin Matuska Date: Mon, 1 Aug 2011 14:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224579 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 14:50:31 -0000 Author: mm Date: Mon Aug 1 14:50:31 2011 New Revision: 224579 URL: http://svn.freebsd.org/changeset/base/224579 Log: Fix integer overflow in txg_delay() by initializing the variable "timeout" as clock_t. Filed as Illumos Bug #1313 Reviewed by: avg Approved by: re (kib) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Aug 1 14:13:08 2011 (r224578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Aug 1 14:50:31 2011 (r224579) @@ -488,7 +488,7 @@ void txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) { tx_state_t *tx = &dp->dp_tx; - int timeout = ddi_get_lbolt() + ticks; + clock_t timeout = ddi_get_lbolt() + ticks; /* don't delay if this txg could transition to quiesing immediately */ if (tx->tx_open_txg > txg || From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 15:56:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04283106566C; Mon, 1 Aug 2011 15:56:41 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E87A88FC0A; Mon, 1 Aug 2011 15:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71FueBn003501; Mon, 1 Aug 2011 15:56:40 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71FueoV003499; Mon, 1 Aug 2011 15:56:40 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201108011556.p71FueoV003499@svn.freebsd.org> From: Joel Dahl Date: Mon, 1 Aug 2011 15:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224580 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 15:56:41 -0000 Author: joel (doc committer) Date: Mon Aug 1 15:56:40 2011 New Revision: 224580 URL: http://svn.freebsd.org/changeset/base/224580 Log: I've rewritten most of this file so assign the copyright to me. Approved by: re (kib) Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Mon Aug 1 14:50:31 2011 (r224579) +++ head/share/man/man4/pcm.4 Mon Aug 1 15:56:40 2011 (r224580) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1998, Luigi Rizzo +.\" Copyright (c) 2009-2011 Joel Dahl .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 16:38:39 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B5E31065670; Mon, 1 Aug 2011 16:38:39 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 3153A8FC1C; Mon, 1 Aug 2011 16:38:38 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 4C8A2E3F07A; Mon, 1 Aug 2011 18:19:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rSeaEHVgBU-z; Mon, 1 Aug 2011 18:19:35 +0200 (CEST) Received: from goofy03.vnode.local (wg.benders.se [212.247.52.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 3A386E3F079; Mon, 1 Aug 2011 18:19:35 +0200 (CEST) Date: Mon, 1 Aug 2011 18:19:33 +0200 From: Joel Dahl To: Hiroki Sato Message-ID: <20110801161933.GN14345@goofy03.vnode.local> References: <201107302309.p6UN9rhJ019321@svn.freebsd.org> <20110801.121233.1052535658641629145.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110801.121233.1052535658641629145.hrs@allbsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, doc@FreeBSD.org, joel@FreeBSD.org Subject: Re: svn commit: r224533 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 16:38:39 -0000 On 01-08-2011 12:12, Hiroki Sato wrote: > Hi Joel, > > Joel Dahl wrote > in <201107302309.p6UN9rhJ019321@svn.freebsd.org>: > > jo> Author: joel (doc committer) > jo> Date: Sat Jul 30 23:09:52 2011 > jo> New Revision: 224533 > jo> URL: http://svn.freebsd.org/changeset/base/224533 > jo> > jo> Log: > jo> Add a better description, a few examples and a couple of minor fixes. > jo> > jo> Reviewed by: brueffer > jo> Approved by: re (kib) > jo> > jo> Modified: > jo> head/share/man/man4/pcm.4 > jo> > jo> Modified: head/share/man/man4/pcm.4 > jo> ============================================================================== > > (snip) > > jo> @@ -173,7 +244,7 @@ controls (bass and treble). > jo> Commonly used for ear-candy or frequency compensation due to the vast > jo> difference in hardware quality. > jo> EQ is disabled by default, but can be enabled with the > jo> -.Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq > jo> +.Va hint.pcm.%d.eq > > : > > jo> -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq > jo> +.It Va hint.pcm.%d.eq > > : > > jo> -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .vpc > jo> +.It Va hint.pcm.%d.vpc > > I know several manual pages are also using this expression (%d) for > replaceables, but I am wondering if this is friendly for average > users. Is ".Ar N" for an integer problematic, for example? I would > like comments since other documents in DocBook have used such a > notation for a long time and I feel we need consistency with them. I changed it to be consistent with the rest of the manual page, but I'm also not a big fan of using %d as it might be a bit confusing for some users... -- Joel From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 19:07:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA86E106564A; Mon, 1 Aug 2011 19:07:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA8CE8FC08; Mon, 1 Aug 2011 19:07:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71J73CN009102; Mon, 1 Aug 2011 19:07:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71J73qB009100; Mon, 1 Aug 2011 19:07:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108011907.p71J73qB009100@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 1 Aug 2011 19:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224581 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 19:07:04 -0000 Author: kib Date: Mon Aug 1 19:07:03 2011 New Revision: 224581 URL: http://svn.freebsd.org/changeset/base/224581 Log: Fix the LK_NOSHARE lockmgr flag interaction with LK_UPGRADE and LK_DOWNGRADE lock ops. Namely, the ops should be NOP since LK_NOSHARE locks are always exclusive. Reported by: rmacklem Reviewed by: attilio Tested by: pho Approved by: re (kensmith) MFC after: 1 week Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Mon Aug 1 15:56:40 2011 (r224580) +++ head/sys/kern/kern_lock.c Mon Aug 1 19:07:03 2011 (r224581) @@ -477,8 +477,18 @@ __lockmgr_args(struct lock *lk, u_int fl return (0); } - if (op == LK_SHARED && (lk->lock_object.lo_flags & LK_NOSHARE)) - op = LK_EXCLUSIVE; + if (lk->lock_object.lo_flags & LK_NOSHARE) { + switch (op) { + case LK_SHARED: + op = LK_EXCLUSIVE; + break; + case LK_UPGRADE: + case LK_DOWNGRADE: + _lockmgr_assert(lk, KA_XLOCKED | KA_NOTRECURSED, + file, line); + return (0); + } + } wakeup_swapper = 0; switch (op) { From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 19:12:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51125106566B; Mon, 1 Aug 2011 19:12:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36EC88FC18; Mon, 1 Aug 2011 19:12:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71JCFE5009315; Mon, 1 Aug 2011 19:12:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71JCFd6009311; Mon, 1 Aug 2011 19:12:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108011912.p71JCFd6009311@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 1 Aug 2011 19:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224582 - in head/sys: compat/linprocfs vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 19:12:16 -0000 Author: kib Date: Mon Aug 1 19:12:15 2011 New Revision: 224582 URL: http://svn.freebsd.org/changeset/base/224582 Log: Implement the linprocfs swaps file, providing information about the configured swap devices in the Linux-compatible format. Based on the submission by: Robert Millan PR: kern/159281 Reviewed by: bde Approved by: re (kensmith) MFC after: 2 weeks Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/vm/swap_pager.c head/sys/vm/swap_pager.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Aug 1 19:07:03 2011 (r224581) +++ head/sys/compat/linprocfs/linprocfs.c Mon Aug 1 19:12:15 2011 (r224582) @@ -502,6 +502,33 @@ linprocfs_dostat(PFS_FILL_ARGS) return (0); } +static int +linprocfs_doswaps(PFS_FILL_ARGS) +{ + struct xswdev xsw; + uintmax_t total, used; + int n; + char devname[SPECNAMELEN + 1]; + + sbuf_printf(sb, "Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n"); + mtx_lock(&Giant); + for (n = 0; ; n++) { + if (swap_dev_info(n, &xsw, devname, sizeof(devname)) != 0) + break; + total = (uintmax_t)xsw.xsw_nblks * PAGE_SIZE / 1024; + used = (uintmax_t)xsw.xsw_used * PAGE_SIZE / 1024; + + /* + * The space and not tab after the device name is on + * purpose. Linux does so. + */ + sbuf_printf(sb, "/dev/%-34s unknown\t\t%jd\t%jd\t-1\n", + devname, total, used); + } + mtx_unlock(&Giant); + return (0); +} + /* * Filler function for proc/uptime */ @@ -1490,6 +1517,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, 0); pfs_create_file(root, "stat", &linprocfs_dostat, NULL, NULL, NULL, PFS_RD); + pfs_create_file(root, "swaps", &linprocfs_doswaps, + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "uptime", &linprocfs_douptime, NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "version", &linprocfs_doversion, Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Aug 1 19:07:03 2011 (r224581) +++ head/sys/vm/swap_pager.c Mon Aug 1 19:12:15 2011 (r224582) @@ -2365,35 +2365,53 @@ swap_pager_status(int *total, int *used) mtx_unlock(&sw_dev_mtx); } -static int -sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) +int +swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) { - int *name = (int *)arg1; - int error, n; - struct xswdev xs; struct swdevt *sp; - - if (arg2 != 1) /* name length */ - return (EINVAL); + char *tmp_devname; + int error, n; n = 0; + error = ENOENT; mtx_lock(&sw_dev_mtx); TAILQ_FOREACH(sp, &swtailq, sw_list) { - if (n == *name) { - mtx_unlock(&sw_dev_mtx); - xs.xsw_version = XSWDEV_VERSION; - xs.xsw_dev = sp->sw_dev; - xs.xsw_flags = sp->sw_flags; - xs.xsw_nblks = sp->sw_nblks; - xs.xsw_used = sp->sw_used; - - error = SYSCTL_OUT(req, &xs, sizeof(xs)); - return (error); + if (n != name) { + n++; + continue; + } + xs->xsw_version = XSWDEV_VERSION; + xs->xsw_dev = sp->sw_dev; + xs->xsw_flags = sp->sw_flags; + xs->xsw_nblks = sp->sw_nblks; + xs->xsw_used = sp->sw_used; + if (devname != NULL) { + if (vn_isdisk(sp->sw_vp, NULL)) + tmp_devname = sp->sw_vp->v_rdev->si_name; + else + tmp_devname = "[file]"; + strncpy(devname, tmp_devname, len); } - n++; + error = 0; + break; } mtx_unlock(&sw_dev_mtx); - return (ENOENT); + return (error); +} + +static int +sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) +{ + struct xswdev xs; + int error; + + if (arg2 != 1) /* name length */ + return (EINVAL); + error = swap_dev_info(*(int *)arg1, &xs, NULL, 0); + if (error != 0) + return (error); + error = SYSCTL_OUT(req, &xs, sizeof(xs)); + return (error); } SYSCTL_INT(_vm, OID_AUTO, nswapdev, CTLFLAG_RD, &nswapdev, 0, Modified: head/sys/vm/swap_pager.h ============================================================================== --- head/sys/vm/swap_pager.h Mon Aug 1 19:07:03 2011 (r224581) +++ head/sys/vm/swap_pager.h Mon Aug 1 19:12:15 2011 (r224582) @@ -75,7 +75,8 @@ struct swdevt { extern int swap_pager_full; extern int swap_pager_avail; -struct swdevt; +struct xswdev; +int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len); void swap_pager_copy(vm_object_t, vm_object_t, vm_pindex_t, int); void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t); void swap_pager_swap_init(void); From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 21:12:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5DBE106566C; Mon, 1 Aug 2011 21:12:41 +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 D51208FC16; Mon, 1 Aug 2011 21:12:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71LCfid012901; Mon, 1 Aug 2011 21:12:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71LCfpi012898; Mon, 1 Aug 2011 21:12:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108012112.p71LCfpi012898@svn.freebsd.org> From: Xin LI Date: Mon, 1 Aug 2011 21:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224583 - in head: share/man/man4 sys/dev/hptiop X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 21:12:42 -0000 Author: delphij Date: Mon Aug 1 21:12:41 2011 New Revision: 224583 URL: http://svn.freebsd.org/changeset/base/224583 Log: Add PCI ID for RocketRAID 4321 and 4322. A FreeNAS user have tested the change on RocketRAID 4322. Sponsored by: iXsystems, Inc. MFC after: 3 days Approved by: re (kib) Modified: head/share/man/man4/hptiop.4 head/sys/dev/hptiop/hptiop.c Modified: head/share/man/man4/hptiop.4 ============================================================================== --- head/share/man/man4/hptiop.4 Mon Aug 1 19:12:15 2011 (r224582) +++ head/share/man/man4/hptiop.4 Mon Aug 1 21:12:41 2011 (r224583) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2007 +.Dd August 1, 2011 .Dt HPTIOP 4 .Os .Sh NAME @@ -60,6 +60,10 @@ driver supports the following SAS and SA .It HighPoint RocketRAID 4320 .It +HighPoint RocketRAID 4321 +.It +HighPoint RocketRAID 4322 +.It HighPoint RocketRAID 3220 .It HighPoint RocketRAID 3320 Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Mon Aug 1 19:12:15 2011 (r224582) +++ head/sys/dev/hptiop/hptiop.c Mon Aug 1 21:12:41 2011 (r224583) @@ -1269,6 +1269,8 @@ static int hptiop_probe(device_t dev) id = pci_get_device(dev); switch (id) { + case 0x4322: + case 0x4321: case 0x4320: sas = 1; case 0x3220: From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 22:21:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B76AB10657A2; Mon, 1 Aug 2011 22:21:18 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A51D08FC19; Mon, 1 Aug 2011 22:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71MLIKb014969; Mon, 1 Aug 2011 22:21:18 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71MLIlm014965; Mon, 1 Aug 2011 22:21:18 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201108012221.p71MLIlm014965@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 1 Aug 2011 22:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224584 - in head: contrib/bsnmp/snmp_usm usr.bin/unzip usr.sbin/bsnmpd/tools/bsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 22:21:18 -0000 Author: uqs Date: Mon Aug 1 22:21:18 2011 New Revision: 224584 URL: http://svn.freebsd.org/changeset/base/224584 Log: Fix broken mdoc. Found by: manlint Approved by: re (kib) Modified: head/contrib/bsnmp/snmp_usm/snmp_usm.3 head/usr.bin/unzip/unzip.1 head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Modified: head/contrib/bsnmp/snmp_usm/snmp_usm.3 ============================================================================== --- head/contrib/bsnmp/snmp_usm/snmp_usm.3 Mon Aug 1 21:12:41 2011 (r224583) +++ head/contrib/bsnmp/snmp_usm/snmp_usm.3 Mon Aug 1 22:21:18 2011 (r224584) @@ -115,7 +115,7 @@ allowed. This column is used to create new USM user entries or delete existing ones from the table. .El -.EL +.El .Sh FILES .Bl -tag -width "XXXXXXXXX" .It Pa /usr/share/snmp/defs/usm_tree.def Modified: head/usr.bin/unzip/unzip.1 ============================================================================== --- head/usr.bin/unzip/unzip.1 Mon Aug 1 21:12:41 2011 (r224583) +++ head/usr.bin/unzip/unzip.1 Mon Aug 1 22:21:18 2011 (r224584) @@ -112,7 +112,7 @@ and .Fl u may be specified. If specified filename is -.Va Qq - , +.Qq - , then data is read from .Va stdin . .Sh ENVIRONMENT Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Mon Aug 1 21:12:41 2011 (r224583) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Mon Aug 1 22:21:18 2011 (r224584) @@ -126,7 +126,7 @@ The options are as follows (not all appl .Bl -tag -width ".It Fl D Ar options" .It Fl A Ar options Authentication options to use with SNMPv3 PDUs -.Bl -tag -width +.Bl -tag -width \& .It Cm proto=[md5|sha] The protocol to use when calculating the PDU message digest. .It Cm key=authkey @@ -147,7 +147,7 @@ The maximum allowed length is 65535 acco Information (SMIv2). .It Fl C Ar options The context to query with SNMPv3 PDUs. -.Bl -tag -width +.Bl -tag -width \& .It Cm context=name The context name. Default is "" (empty). .It Cm context-engine=engine-id @@ -172,19 +172,21 @@ Print a short help text with default val Load each MIB description file from the given list to translate symbolic object names to their numerical representation and vice versa. Use the other options to obtain a non-default behaviour: -.Bl -tag -width +.Bl -tag -width \& .It Cm cut=OID Specifies the initial OID that was cut by .Xr gensnmpdef 1 when producing the MIB description file. The default value is .iso(1).org(3).dod(6) which is what should have been -used for all the files installed under /usr/share/snmp/defs/ . -Use this only if you generated your own files, providing a '-c' option to +used for all the files installed under /usr/share/snmp/defs. +Use this only if you generated your own files, providing a +.Fl c +option to .Xr gensnmpdef 1 . .It Cm path=filedir The directory where files in the list will be searched. The default is -.Pa /usr/share/snmp/defs/ . +.Pa /usr/share/snmp/defs Ns . .It Cm file=filelist A comma separated list of files to which the two options above will apply. .El @@ -206,7 +208,7 @@ will search to translate numerical OIDs Multiple files can be provided either giving this option multiple times or a comma separated list of file names. If a filename begins with a letter the default directory, -/usr/share/snmp/defs/ , +/usr/share/snmp/defs, will be searched. .It Fl K Calculate and display the localized authentication and privacy keys @@ -239,7 +241,7 @@ representation and the value. In addition to the short output verbose prints the type before the value. .It Fl P Ar options Privacy options to use with SNMPv3 PDUs -.Bl -tag -width +.Bl -tag -width \& .It Cm proto=[aes|des] The protocol to use when encypting/decrypting SNMPv3 PDU data. .It Cm key=privkey @@ -257,9 +259,11 @@ not respond after the first try. Default is 3. .It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port] Each of the server specification components is optional but at least one -has to be provided if '-s' option is used. +has to be provided if +.Ar s +option is used. The server specification is constructed in the following manner: -.Bl -tag -width +.Bl -tag -width \& .It Cm trans:: Transport type may be one of udp, stream or dgram. If this option is not provided an udp inet/inet6 socket will be used, which @@ -277,11 +281,16 @@ and the default "private" community stri .It Cm server This might be either the IP address or the hostname where the agent is listening. -The default is 'localhost'. +The default is +.Qq localhost . .It Cm port The destination port to send the requests to. This is useful if the SNMP agent listens on a non-default port. -Default is given by the 'snmp' entry in /etc/services, port 161. +Default is given by the +.Qq snmp +entry in +.Pa /etc/services , +port 161. .El .It Fl t Ar timeout Number of seconds before resending a request packet if the agent does @@ -289,7 +298,7 @@ not respond. The default value is 3 seconds. .It Fl U Ar options User credentials when sending SNMPv3 PDUs. -.Bl -tag -width +.Bl -tag -width \& .It Cm engine=id The Engine ID of the SNMP agent represented as a binary octet string. .It Cm engine-boots=value @@ -331,14 +340,16 @@ at .iso(1).org(3).dod(6).internet(1).mgm .Pp Any of the formats used to print a single variable is valid as input OID: -.Bl -tag -width +.Bl -tag -width \& .It 1.3.6.1.2.1.25.1.1.0 .It sysDescr .It ifPhysAddress.1 .It ifRcvAddressStatus.2.6.255.255.255.255.255.255 .It ifRcvAddressType[2,ff:ff:ff:ff:ff:ff] .It ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff] -(requires '-o verbose' option) +(requires +.Fl o Ar verbose +option) .El .Pp Square brackets are used to denote an entry's indexes. @@ -350,34 +361,39 @@ The object identifier with its syntax ty At least one such string OID=[syntax:]value should be provided to .Nm bsnmpset to be able to send a request. -.Bl -tag -width +.Bl -tag -width \& .It Cm OID OID may be input as a string, a string followed by a random number of integers (suboids) separated by dots, a sequence of integers separated by dots - that is -if '-n' options is used - and in such case a syntax is required for every value, +if +.Ar n +options is used - and in such case a syntax is required for every value, or a string followed by square brackets (used to denote an entry's indexes) and corresponding indexes. Any of formats used to print a single variable by .Nm bsnmpset is valid for inpit OID as well: -.Bl -tag -width +.Bl -tag -width \& .It 1.3.6.1.2.1.25.1.1.0=TimeTicks:537615486 -.It sysLocation=OctetString:"@ Home" (with '-o verbose' option) +.It sysLocation=OctetString:"@ Home" (with Fl o Ar verbose No option) .It sysLocation.0="@ Home" .It 1.3.6.1.2.1.2.2.1.6.1=OctetString:ffffffffffff .It ifPhysAddress.1="00:02:b3:1d:1c:a3" .It ifRcvAddressStatus.1.6.255.255.255.255.255.255=1 .It "ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]=Integer:1" -(with '-o verbose' option) +(with +.Fl o Ar verbose +option) .El .It Cm syntax -where syntax string is one of : +where syntax string is one of: Integer, OctetString, OID, IpAddress, Counter32, Gauge, TimeTicks, Counter64. .It Cm value -The value to be set - IP address in form of u.u.u.u - for example +The value to be set - IP address in form of u.u.u.u - for example 1.3.1.6.1.2.0=IpAddress:192.168.0.1, strings require inverted-commas if they contain any special characters or spaces, all other numeric types don't. .El +.El .Sh ENVIRONMENT .Nm , .Nm bsnmpwalk @@ -395,6 +411,7 @@ Specifies a default SNMP USM user name. Specifies the SNMP USM plain text password to use when calculating localized authentication and privacy keys. If this variable exists in the environment, SMNPv3 is the default version to use for outgoing requests. +.El .Sh SEE ALSO .Xr gensnmpdef 1 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Mon Aug 1 23:05:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 00494106566C; Mon, 1 Aug 2011 23:05:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0B7CF154C24; Mon, 1 Aug 2011 23:05:35 +0000 (UTC) Message-ID: <4E37313E.9040908@FreeBSD.org> Date: Mon, 01 Aug 2011 16:05:34 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:5.0) Gecko/20110723 Thunderbird/5.0 MIME-Version: 1.0 To: Glen Barber References: <201107232255.p6NMtWNp080295@svn.freebsd.org> <4E35E6FB.5040409@FreeBSD.org> <20110801122518.GA81095@onyx.glenbarber.us> In-Reply-To: <20110801122518.GA81095@onyx.glenbarber.us> X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224284 - in head: share/man/man4 share/man/man5 share/man/man8 usr.sbin/faithd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 23:05:43 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 08/01/2011 05:25, Glen Barber wrote: > Doug Barton wrote: >> On 07/23/2011 15:55, Glen Barber wrote: >>> +.%U http://www.ietf.org/rfc/rfc2893.txt >> >> References to IETF documents in our documentation should use the >> tools.ietf.org site. It gives a much nicer experience, including >> working HTML tags, etc. For instance, the link for this page should >> be: >> >> http://tools.ietf.org/html/rfc2893 >> > > Thanks, Doug. I'll fix this later today. Awesome. :) Sorry it took so long for me to send the message btw, but I'm totally swamped atm. Doug - -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJONzE+AAoJEFzGhvEaGryEk7wIAKEikbS6a+2DDub3AMYm7pzs T5cLLwEIGClS0KEMJWv6P/XnLx/LdJnc2E6aZlbnFu7A1DSjofXtUMv2LLOH2oQ1 kjkDkrXMdgM7oeYOUHGzRBkdJZe2y7UIyIgTHYAFyjx8smKcWz5/Coiv3HyrDD/I OFL/3QRK4ddZdSHVqNjcAAzGDwHgpVFE0tv60Q/cnCCys1g3GPHYHIdtAQexQhTp DnckOReblJUCi7IGaYjVx0dgWGpxdF63yl3rH91lg69ECxuzoSs29XepiOEndnmg 1mOw7XD7qeni5LwMWbCh198KYxWhL148ytJi9DGmyn5bLU1UbpO0Kz5fhE+Sjyk= =jb2s -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 01:48:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 172FA106564A; Tue, 2 Aug 2011 01:48:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C118FC12; Tue, 2 Aug 2011 01:48:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p721mjqb021318; Tue, 2 Aug 2011 01:48:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p721mjMK021316; Tue, 2 Aug 2011 01:48:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201108020148.p721mjMK021316@svn.freebsd.org> From: Glen Barber Date: Tue, 2 Aug 2011 01:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224587 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 01:48:46 -0000 Author: gjb (doc committer) Date: Tue Aug 2 01:48:45 2011 New Revision: 224587 URL: http://svn.freebsd.org/changeset/base/224587 Log: Provide a more user friendly URL to the IETF site in gif(4). Pointed out by: dougb MFC after: 3 days Approved by: re (hrs) Modified: head/share/man/man4/gif.4 Modified: head/share/man/man4/gif.4 ============================================================================== --- head/share/man/man4/gif.4 Tue Aug 2 00:46:25 2011 (r224586) +++ head/share/man/man4/gif.4 Tue Aug 2 01:48:45 2011 (r224587) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2011 +.Dd August 1, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%U http://www.ietf.org/rfc/rfc2893.txt +.%U http://tools.ietf.org/html/rfc2893 .Re .Rs .%A Sally Floyd From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 02:46:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CFEE1065672; Tue, 2 Aug 2011 02:46:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC3D8FC08; Tue, 2 Aug 2011 02:46:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p722k3lx023069; Tue, 2 Aug 2011 02:46:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p722k3uZ023066; Tue, 2 Aug 2011 02:46:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108020246.p722k3uZ023066@svn.freebsd.org> From: Adrian Chadd Date: Tue, 2 Aug 2011 02:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224588 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 02:46:04 -0000 Author: adrian Date: Tue Aug 2 02:46:03 2011 New Revision: 224588 URL: http://svn.freebsd.org/changeset/base/224588 Log: Fix a corner case in RXEOL handling which was likely introduced by yours truly. Before 802.11n, the RX descriptor list would employ the "self-linked tail descriptor" trick which linked the last descriptor back to itself. This way, the RX engine would never hit the "end" of the list and stop processing RX (and assert RXEOL) as it never hit a descriptor whose next pointer was 0. It would just keep overwriting the last descriptor until the software freed up some more RX descriptors and chained them onto the end. For 802.11n, this needs to stop as a self-linked RX descriptor tickles the block-ack logic into ACK'ing whatever frames are received into that self-linked descriptor - so in very busy periods, you could end up with A-MPDU traffic that is ACKed but never received by the 802.11 stack. This would cause some confusion as the ADDBA windows would suddenly be out of sync. So when that occured here, the last descriptor would be hit and the PCU logic would stop. It would only start again when the RX descriptor list was updated and the PCU RX engine was re-tickled. That wasn't being done, so RXEOL would be continuously asserted and no RX would continue. This patch introduces a new flag - sc->sc_kickpcu - which when set, signals the RX task to kick the PCU after its processed whatever packets it can. This way completed packets aren't discarded. In case some other task gets called which resets the hardware, don't update sc->sc_imask - instead, just update the hardware interrupt mask directly and let either ath_rx_proc() or ath_reset() restore the imask to its former setting. Note: this bug was only triggered when doing a whole lot of frame snooping with serial console IO in the RX task. This would defer interrupt processing enough to cause an RX descriptor overflow. It doesn't happen in normal conditions. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Aug 2 01:48:45 2011 (r224587) +++ head/sys/dev/ath/if_ath.c Tue Aug 2 02:46:03 2011 (r224588) @@ -1389,6 +1389,7 @@ ath_intr(void *arg) } } if (status & HAL_INT_RXEOL) { + int imask = sc->sc_imask; /* * NB: the hardware should re-read the link when * RXE bit is written, but it doesn't work at @@ -1398,10 +1399,22 @@ ath_intr(void *arg) /* * Disable RXEOL/RXORN - prevent an interrupt * storm until the PCU logic can be reset. + * In case the interface is reset some other + * way before "sc_kickpcu" is called, don't + * modify sc_imask - that way if it is reset + * by a call to ath_reset() somehow, the + * interrupt mask will be correctly reprogrammed. */ - sc->sc_imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); - ath_hal_intrset(ah, sc->sc_imask); + imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); + ath_hal_intrset(ah, imask); + /* + * Enqueue an RX proc, to handled whatever + * is in the RX queue. + * This will then kick the PCU. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); sc->sc_rxlink = NULL; + sc->sc_kickpcu = 1; } if (status & HAL_INT_TXURN) { sc->sc_stats.ast_txurn++; @@ -3776,6 +3789,25 @@ rx_next: if (ath_dfs_tasklet_needed(sc, sc->sc_curchan)) taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask); + /* + * Now that all the RX frames were handled that + * need to be handled, kick the PCU if there's + * been an RXEOL condition. + */ + if (sc->sc_kickpcu) { + sc->sc_kickpcu = 0; + ath_stoprecv(sc); + sc->sc_imask |= (HAL_INT_RXEOL | HAL_INT_RXORN); + if (ath_startrecv(sc) != 0) { + if_printf(ifp, + "%s: couldn't restart RX after RXEOL; resetting\n", + __func__); + ath_reset(ifp); + return; + } + ath_hal_intrset(ah, sc->sc_imask); + } + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Aug 2 01:48:45 2011 (r224587) +++ head/sys/dev/ath/if_athvar.h Tue Aug 2 02:46:03 2011 (r224588) @@ -254,7 +254,8 @@ struct ath_softc { sc_tdma : 1,/* TDMA in use */ sc_setcca : 1,/* set/clr CCA with TDMA */ sc_resetcal : 1,/* reset cal state next trip */ - sc_rxslink : 1;/* do self-linked final descriptor */ + sc_rxslink : 1,/* do self-linked final descriptor */ + sc_kickpcu : 1;/* kick PCU RX on next RX proc */ uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 11:07:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4779A106566C; Tue, 2 Aug 2011 11:07:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 375E48FC0A; Tue, 2 Aug 2011 11:07:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72B7maE047152; Tue, 2 Aug 2011 11:07:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72B7m69047149; Tue, 2 Aug 2011 11:07:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108021107.p72B7m69047149@svn.freebsd.org> From: Alexander Motin Date: Tue, 2 Aug 2011 11:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224603 - in head/sys/dev: ahci ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 11:07:48 -0000 Author: mav Date: Tue Aug 2 11:07:47 2011 New Revision: 224603 URL: http://svn.freebsd.org/changeset/base/224603 Log: Do not force AHCI mode on NVIDIA MCP89 SATA controllers. Recent Apple Mac with this chipset does not initialize AHCI mode unless it is started from EFI loader. However, legacy ATA mode works. Submitted by: jkim@ (original version) Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/chipsets/ata-nvidia.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue Aug 2 09:43:27 2011 (r224602) +++ head/sys/dev/ahci/ahci.c Tue Aug 2 11:07:47 2011 (r224603) @@ -264,7 +264,7 @@ static struct { {0x0abe10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, {0x0abf10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, {0x0d8410de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOFORCE|AHCI_Q_NOAA}, {0x0d8610de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8710de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8810de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Tue Aug 2 09:43:27 2011 (r224602) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Tue Aug 2 11:07:47 2011 (r224603) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_nvidia_chipinit(device_t dev); static int ata_nvidia_ch_attach(device_t dev); +static int ata_nvidia_ch_attach_dumb(device_t dev); static int ata_nvidia_status(device_t dev); static void ata_nvidia_reset(device_t dev); static int ata_nvidia_setmode(device_t dev, int target, int mode); @@ -62,6 +63,7 @@ static int ata_nvidia_setmode(device_t d #define NV4 0x01 #define NVQ 0x02 #define NVAHCI 0x04 +#define NVNOFORCE 0x08 /* @@ -158,7 +160,7 @@ ata_nvidia_probe(device_t dev) { ATA_NFORCE_MCP79_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP79" }, { ATA_NFORCE_MCP79_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP79" }, { ATA_NFORCE_MCP89_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, - { ATA_NFORCE_MCP89_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, + { ATA_NFORCE_MCP89_A1, 0, NVAHCI|NVNOFORCE, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, @@ -178,7 +180,9 @@ ata_nvidia_probe(device_t dev) return ENXIO; ata_set_desc(dev); - if (ctlr->chip->cfg1 & NVAHCI) + if ((ctlr->chip->cfg1 & NVAHCI) && + ((ctlr->chip->cfg1 & NVNOFORCE) == 0 || + pci_get_subclass(dev) != PCIS_STORAGE_IDE)) ctlr->chipinit = ata_ahci_chipinit; else ctlr->chipinit = ata_nvidia_chipinit; @@ -193,7 +197,10 @@ ata_nvidia_chipinit(device_t dev) if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - if (ctlr->chip->max_dma >= ATA_SA150) { + if (ctlr->chip->cfg1 & NVAHCI) { + ctlr->ch_attach = ata_nvidia_ch_attach_dumb; + ctlr->setmode = ata_sata_setmode; + } else if (ctlr->chip->max_dma >= ATA_SA150) { if (pci_read_config(dev, PCIR_BAR(5), 1) & 1) ctlr->r_type2 = SYS_RES_IOPORT; else @@ -264,6 +271,17 @@ ata_nvidia_ch_attach(device_t dev) return 0; } +static int +ata_nvidia_ch_attach_dumb(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + if (ata_pci_ch_attach(dev)) + return ENXIO; + ch->flags |= ATA_SATA; + return 0; +} + static int ata_nvidia_status(device_t dev) { From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 11:24:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7D53106564A; Tue, 2 Aug 2011 11:24:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE9BA8FC14; Tue, 2 Aug 2011 11:24:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72BOgIr047933; Tue, 2 Aug 2011 11:24:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72BOgEU047930; Tue, 2 Aug 2011 11:24:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201108021124.p72BOgEU047930@svn.freebsd.org> From: Rick Macklem Date: Tue, 2 Aug 2011 11:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224604 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 11:24:42 -0000 Author: rmacklem Date: Tue Aug 2 11:24:42 2011 New Revision: 224604 URL: http://svn.freebsd.org/changeset/base/224604 Log: Fix a LOR in the NFS client which could cause a deadlock. This was reported to the mailing list freebsd-net@freebsd.org on July 21, 2011 under the subject "LOR with nfsclient sillyrename". The LOR occurred when nfs_inactive() called vrele(sp->s_dvp) while holding the vnode lock on the file in s_dvp. This patch modifies the client so that it performs the vrele(sp->s_dvp) as a separate task to avoid the LOR. This fix was discussed with jhb@ and kib@, who both proposed variations of it. Tested by: pho, jlott at averesystems.com Submitted by: jhb (earlier version) Reviewed by: kib Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/nfsclient/nfs_node.c head/sys/nfsclient/nfsnode.h Modified: head/sys/nfsclient/nfs_node.c ============================================================================== --- head/sys/nfsclient/nfs_node.c Tue Aug 2 11:07:47 2011 (r224603) +++ head/sys/nfsclient/nfs_node.c Tue Aug 2 11:24:42 2011 (r224604) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -59,6 +60,8 @@ __FBSDID("$FreeBSD$"); static uma_zone_t nfsnode_zone; +static void nfs_freesillyrename(void *arg, __unused int pending); + #define TRUE 1 #define FALSE 0 @@ -185,6 +188,20 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh return (0); } +/* + * Do the vrele(sp->s_dvp) as a separate task in order to avoid a + * deadlock because of a LOR when vrele() locks the directory vnode. + */ +static void +nfs_freesillyrename(void *arg, __unused int pending) +{ + struct sillyrename *sp; + + sp = arg; + vrele(sp->s_dvp); + free(sp, M_NFSREQ); +} + int nfs_inactive(struct vop_inactive_args *ap) { @@ -207,8 +224,8 @@ nfs_inactive(struct vop_inactive_args *a */ (sp->s_removeit)(sp); crfree(sp->s_cred); - vrele(sp->s_dvp); - free((caddr_t)sp, M_NFSREQ); + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); + taskqueue_enqueue(taskqueue_thread, &sp->s_task); mtx_lock(&np->n_mtx); } np->n_flag &= NMODIFIED; Modified: head/sys/nfsclient/nfsnode.h ============================================================================== --- head/sys/nfsclient/nfsnode.h Tue Aug 2 11:07:47 2011 (r224603) +++ head/sys/nfsclient/nfsnode.h Tue Aug 2 11:24:42 2011 (r224604) @@ -36,6 +36,7 @@ #ifndef _NFSCLIENT_NFSNODE_H_ #define _NFSCLIENT_NFSNODE_H_ +#include #if !defined(_NFSCLIENT_NFS_H_) && !defined(_KERNEL) #include #endif @@ -45,6 +46,7 @@ * can be removed by nfs_inactive() */ struct sillyrename { + struct task s_task; struct ucred *s_cred; struct vnode *s_dvp; int (*s_removeit)(struct sillyrename *sp); From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 11:28:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85A5C1065672; Tue, 2 Aug 2011 11:28:33 +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 75EED8FC14; Tue, 2 Aug 2011 11:28:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72BSXhg048134; Tue, 2 Aug 2011 11:28:33 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72BSXjc048132; Tue, 2 Aug 2011 11:28:33 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108021128.p72BSXjc048132@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Aug 2011 11:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224605 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 11:28:33 -0000 Author: mm Date: Tue Aug 2 11:28:33 2011 New Revision: 224605 URL: http://svn.freebsd.org/changeset/base/224605 Log: Fix panic in zfs_read() if IO_SYNC flag supplied by checking for zfsvfs->z_log before calling zil_commit(). [1] Do not call zfs_read() from zfs_getextattr() with the IO_SYNC flag. Submitted by: Alexander Zagrebin [1] Reviewed by: pjd@ Approved by: re (kib) MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 2 11:24:42 2011 (r224604) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Aug 2 11:28:33 2011 (r224605) @@ -612,7 +612,8 @@ zfs_read(vnode_t *vp, uio_t *uio, int io /* * If we're in FRSYNC mode, sync out this znode before reading it. */ - if (ioflag & FRSYNC || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) + if (zfsvfs->z_log && + (ioflag & FRSYNC || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)) zil_commit(zfsvfs->z_log, zp->z_id); /* @@ -6340,7 +6341,7 @@ vop_getextattr { if (error == 0) *ap->a_size = (size_t)va.va_size; } else if (ap->a_uio != NULL) - error = VOP_READ(vp, ap->a_uio, IO_UNIT | IO_SYNC, ap->a_cred); + error = VOP_READ(vp, ap->a_uio, IO_UNIT, ap->a_cred); VOP_UNLOCK(vp, 0); vn_close(vp, flags, ap->a_cred, td); From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 11:28:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DA7E106564A; Tue, 2 Aug 2011 11:28:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 146988FC0A; Tue, 2 Aug 2011 11:28:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72BSgEc048182; Tue, 2 Aug 2011 11:28:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72BSgiC048179; Tue, 2 Aug 2011 11:28:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201108021128.p72BSgiC048179@svn.freebsd.org> From: Rick Macklem Date: Tue, 2 Aug 2011 11:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224606 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 11:28:43 -0000 Author: rmacklem Date: Tue Aug 2 11:28:42 2011 New Revision: 224606 URL: http://svn.freebsd.org/changeset/base/224606 Log: Fix a LOR in the NFS client which could cause a deadlock. This was reported to the mailing list freebsd-net@freebsd.org on July 21, 2011 under the subject "LOR with nfsclient sillyrename". The LOR occurred when nfs_inactive() called vrele(sp->s_dvp) while holding the vnode lock on the file in s_dvp. This patch modifies the client so that it performs the vrele(sp->s_dvp) as a separate task to avoid the LOR. This fix was discussed with jhb@ and kib@, who both proposed variations of it. Tested by: pho, jlott at averesystems.com Submitted by: jhb (earlier version) Reviewed by: kib Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfsnode.h Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Tue Aug 2 11:28:33 2011 (r224605) +++ head/sys/fs/nfsclient/nfs_clnode.c Tue Aug 2 11:28:42 2011 (r224606) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -65,6 +66,8 @@ MALLOC_DECLARE(M_NEWNFSREQ); uma_zone_t newnfsnode_zone; +static void nfs_freesillyrename(void *arg, __unused int pending); + void ncl_nhinit(void) { @@ -186,6 +189,20 @@ ncl_nget(struct mount *mntp, u_int8_t *f return (0); } +/* + * Do the vrele(sp->s_dvp) as a separate task in order to avoid a + * deadlock because of a LOR when vrele() locks the directory vnode. + */ +static void +nfs_freesillyrename(void *arg, __unused int pending) +{ + struct sillyrename *sp; + + sp = arg; + vrele(sp->s_dvp); + free(sp, M_NEWNFSREQ); +} + int ncl_inactive(struct vop_inactive_args *ap) { @@ -220,8 +237,8 @@ ncl_inactive(struct vop_inactive_args *a */ ncl_removeit(sp, vp); crfree(sp->s_cred); - vrele(sp->s_dvp); - FREE((caddr_t)sp, M_NEWNFSREQ); + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); + taskqueue_enqueue(taskqueue_thread, &sp->s_task); mtx_lock(&np->n_mtx); } np->n_flag &= NMODIFIED; Modified: head/sys/fs/nfsclient/nfsnode.h ============================================================================== --- head/sys/fs/nfsclient/nfsnode.h Tue Aug 2 11:28:33 2011 (r224605) +++ head/sys/fs/nfsclient/nfsnode.h Tue Aug 2 11:28:42 2011 (r224606) @@ -35,11 +35,14 @@ #ifndef _NFSCLIENT_NFSNODE_H_ #define _NFSCLIENT_NFSNODE_H_ +#include + /* * Silly rename structure that hangs off the nfsnode until the name * can be removed by nfs_inactive() */ struct sillyrename { + struct task s_task; struct ucred *s_cred; struct vnode *s_dvp; long s_namlen; From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 11:35:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E42A1065687; Tue, 2 Aug 2011 11:35:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0528FC19; Tue, 2 Aug 2011 11:35:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72BZSR1048647; Tue, 2 Aug 2011 11:35:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72BZSAN048645; Tue, 2 Aug 2011 11:35:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201108021135.p72BZSAN048645@svn.freebsd.org> From: Glen Barber Date: Tue, 2 Aug 2011 11:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224609 - head/usr.sbin/faithd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 11:35:28 -0000 Author: gjb (doc committer) Date: Tue Aug 2 11:35:28 2011 New Revision: 224609 URL: http://svn.freebsd.org/changeset/base/224609 Log: Provide a more user friendly URL to the IETF site in faithd(8). Pointed out by: dougb Approved by: re (kib) MFC after: 3 days Modified: head/usr.sbin/faithd/faithd.8 Modified: head/usr.sbin/faithd/faithd.8 ============================================================================== --- head/usr.sbin/faithd/faithd.8 Tue Aug 2 11:34:59 2011 (r224608) +++ head/usr.sbin/faithd/faithd.8 Tue Aug 2 11:35:28 2011 (r224609) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2011 +.Dd August 2, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%U http://www.ietf.org/rfc/rfc3142.txt +.%U http://tools.ietf.org/html/rfc3142 .%D June 2001 .Re .\" From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 15:35:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF631106566C; Tue, 2 Aug 2011 15:35:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B54008FC12; Tue, 2 Aug 2011 15:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72FZhQ3058160; Tue, 2 Aug 2011 15:35:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72FZhne058156; Tue, 2 Aug 2011 15:35:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108021535.p72FZhne058156@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 2 Aug 2011 15:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224611 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 15:35:44 -0000 Author: marcel Date: Tue Aug 2 15:35:43 2011 New Revision: 224611 URL: http://svn.freebsd.org/changeset/base/224611 Log: Add support for Juniper's loader. The difference between FreeBSD's and Juniper's loader is that Juniper's loader maps all of the kernel and preloaded modules at the right virtual address before jumping into the kernel. FreeBSD's loader simply maps 16MB using the physical address and expects the kernel to jump through hoops to relocate itself to it's virtual address. The problem with the FreeBSD loader's approach is that it typically maps too much or too little. There's no harm if it's too much (other than wasting space), but if it's too little then the kernel will simply not boot, because the first thing the kernel needs is the bootinfo structure, which is never mapped in that case. The page fault that early is fatal. The changes constitute: 1. Do not remap the kernel in locore.S. We're mapped where we need to be so we can pretty much call into C code after setting up the stack. 2. With kernload and kernload_ap not set in locore.S, we need to set them in pmap.c: kernload gets defined when we preserve the TLB1. Here we also determine the size of the kernel mapped. kernload_ap is set first thing in the pmap_bootstrap() method. 3. Fix tlb1_map_region() and its use to properly externd the mapped kernel size to include low-level data structures. Approved by: re (blanket) Obtained from: Juniper Networks, Inc Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Aug 2 12:43:40 2011 (r224610) +++ head/sys/powerpc/booke/locore.S Tue Aug 2 15:35:43 2011 (r224611) @@ -83,8 +83,7 @@ __start: * locore registers use: * r1 : stack pointer * r2 : trace pointer (AP only, for early diagnostics) - * r3-r26 : scratch registers - * r27 : kernload + * r3-r27 : scratch registers * r28 : temp TLB1 entry * r29 : initial TLB1 entry we started in * r30-r31 : arguments (metadata pointer) @@ -116,6 +115,9 @@ __start: li %r3, 0 bl tlb_inval_all + cmpwi %r30, 0 + beq done_mapping + /* * Locate the TLB1 entry that maps this code */ @@ -171,7 +173,6 @@ __start: bl 3f 3: mflr %r4 /* Use current address */ rlwinm %r4, %r4, 0, 0, 7 /* 16MB alignment mask */ - mr %r27, %r4 /* Keep kernel load address */ ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r4 /* Set RPN and protection */ isync @@ -197,23 +198,7 @@ __start: mr %r3, %r28 bl tlb1_inval_entry -/* - * Save kernel load address for later use. - */ - lis %r3, kernload@ha - addi %r3, %r3, kernload@l - stw %r27, 0(%r3) -#ifdef SMP - /* - * APs need a separate copy of kernload info within the __boot_page - * area so they can access this value very early, before their TLBs - * are fully set up and the kernload global location is available. - */ - lis %r3, kernload_ap@ha - addi %r3, %r3, kernload_ap@l - stw %r27, 0(%r3) - msync -#endif +done_mapping: /* * Setup a temporary stack @@ -257,7 +242,7 @@ __start: __boot_page: bl 1f -kernload_ap: +GLOBAL(kernload_ap): .long 0 /* @@ -785,8 +770,6 @@ tmpstack: */ #define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */ -GLOBAL(kernload) - .long 0 GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 GLOBAL(sintrnames) Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Tue Aug 2 12:43:40 2011 (r224610) +++ head/sys/powerpc/booke/platform_bare.c Tue Aug 2 15:35:43 2011 (r224611) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #ifdef SMP extern void *ap_pcpu; extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t kernload; /* Kernel physical load address */ +extern uint32_t kernload_ap; /* Kernel physical load address */ #endif extern uint32_t *bootinfo; @@ -178,9 +178,13 @@ bare_timebase_freq(platform_t plat, stru phandle_t cpus, child; pcell_t freq; - if (bootinfo != NULL) { - /* Backward compatibility. See 8-STABLE. */ - ticks = bootinfo[3] >> 3; + if (bootinfo != NULL) + if (bootinfo[0] == 1) { + /* Backward compatibility. See 8-STABLE. */ + ticks = bootinfo[3] >> 3; + } else { + /* Compatbility with Juniper's loader. */ + ticks = bootinfo[5] >> 3; } else ticks = 0; @@ -268,7 +272,7 @@ bare_smp_start_cpu(platform_t plat, stru /* * Set BPTR to the physical address of the boot page */ - bptr = ((uint32_t)__boot_page - KERNBASE) + kernload; + bptr = ((uint32_t)__boot_page - KERNBASE) + kernload_ap; ccsr_write4(OCP85XX_BPTR, (bptr >> 12) | 0x80000000); /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Aug 2 12:43:40 2011 (r224610) +++ head/sys/powerpc/booke/pmap.c Tue Aug 2 15:35:43 2011 (r224611) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -111,8 +112,13 @@ extern int dumpsys_minidump; extern unsigned char _etext[]; extern unsigned char _end[]; -/* Kernel physical load address. */ -extern uint32_t kernload; +extern uint32_t *bootinfo; + +#ifdef SMP +extern uint32_t kernload_ap; +#endif + +vm_paddr_t kernload; vm_offset_t kernstart; vm_size_t kernsize; @@ -196,7 +202,7 @@ static void tlb_print_entry(int, uint32_ static int tlb1_set_entry(vm_offset_t, vm_offset_t, vm_size_t, uint32_t); static void tlb1_write_entry(unsigned int); static int tlb1_iomapped(int, vm_paddr_t, vm_size_t, vm_offset_t *); -static vm_size_t tlb1_mapin_region(vm_offset_t, vm_offset_t, vm_size_t); +static vm_size_t tlb1_mapin_region(vm_offset_t, vm_paddr_t, vm_size_t); static vm_size_t tsize2size(unsigned int); static unsigned int size2tsize(vm_size_t); @@ -962,19 +968,37 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: entered\n"); +#ifdef SMP + kernload_ap = kernload; +#endif + + /* Initialize invalidation mutex */ mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN); /* Read TLB0 size and associativity. */ tlb0_get_tlbconf(); - /* Align kernel start and end address (kernel image). */ + /* + * Align kernel start and end address (kernel image). + * Note that kernel end does not necessarily relate to kernsize. + * kernsize is the size of the kernel that is actually mapped. + */ kernstart = trunc_page(start); data_start = round_page(kernelend); - kernsize = data_start - kernstart; - data_end = data_start; + /* + * Addresses of preloaded modules (like file systems) use + * physical addresses. Make sure we relocate those into + * virtual addresses. + */ + preload_addr_relocate = kernstart - kernload; + + /* Allocate the dynamic per-cpu area. */ + dpcpu = (void *)data_end; + data_end += DPCPU_SIZE; + /* Allocate space for the message buffer. */ msgbufp = (struct msgbuf *)data_end; data_end += msgbufsize; @@ -983,11 +1007,6 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset data_end = round_page(data_end); - /* Allocate the dynamic per-cpu area. */ - dpcpu = (void *)data_end; - data_end += DPCPU_SIZE; - dpcpu_init(dpcpu, 0); - /* Allocate space for ptbl_bufs. */ ptbl_bufs = (struct ptbl_buf *)data_end; data_end += sizeof(struct ptbl_buf) * PTBL_BUFS; @@ -1005,22 +1024,19 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, data_end); debugf(" data_end: 0x%08x\n", data_end); - if (data_end - kernstart > 0x1000000) { - data_end = (data_end + 0x3fffff) & ~0x3fffff; - tlb1_mapin_region(kernstart + 0x1000000, - kernload + 0x1000000, data_end - kernstart - 0x1000000); - } else - data_end = (data_end + 0xffffff) & ~0xffffff; - + if (data_end - kernstart > kernsize) { + kernsize += tlb1_mapin_region(kernstart + kernsize, + kernload + kernsize, (data_end - kernstart) - kernsize); + } + data_end = kernstart + kernsize; debugf(" updated data_end: 0x%08x\n", data_end); - kernsize += data_end - data_start; - /* * Clear the structures - note we can only do it safely after the * possible additional TLB1 translations are in place (above) so that * all range up to the currently calculated 'data_end' is covered. */ + dpcpu_init(dpcpu, 0); memset((void *)ptbl_bufs, 0, sizeof(struct ptbl_buf) * PTBL_SIZE); memset((void *)kernel_pdir, 0, kernel_ptbls * PTBL_PAGES * PAGE_SIZE); @@ -2926,22 +2942,6 @@ tlb1_set_entry(vm_offset_t va, vm_offset return (0); } -static int -tlb1_entry_size_cmp(const void *a, const void *b) -{ - const vm_size_t *sza; - const vm_size_t *szb; - - sza = a; - szb = b; - if (*sza > *szb) - return (-1); - else if (*sza < *szb) - return (1); - else - return (0); -} - /* * Map in contiguous RAM region into the TLB1 using maximum of * KERNEL_REGION_MAX_TLB_ENTRIES entries. @@ -2950,64 +2950,60 @@ tlb1_entry_size_cmp(const void *a, const * used by all allocated entries. */ vm_size_t -tlb1_mapin_region(vm_offset_t va, vm_offset_t pa, vm_size_t size) +tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_size_t size) { - vm_size_t entry_size[KERNEL_REGION_MAX_TLB_ENTRIES]; - vm_size_t mapped_size, sz, esz; - unsigned int log; - int i; - - CTR4(KTR_PMAP, "%s: region size = 0x%08x va = 0x%08x pa = 0x%08x", - __func__, size, va, pa); - - mapped_size = 0; - sz = size; - memset(entry_size, 0, sizeof(entry_size)); - - /* Calculate entry sizes. */ - for (i = 0; i < KERNEL_REGION_MAX_TLB_ENTRIES && sz > 0; i++) { - - /* Largest region that is power of 4 and fits within size */ - log = ilog2(sz) / 2; - esz = 1 << (2 * log); - - /* If this is last entry cover remaining size. */ - if (i == KERNEL_REGION_MAX_TLB_ENTRIES - 1) { - while (esz < sz) - esz = esz << 2; - } - - entry_size[i] = esz; - mapped_size += esz; - if (esz < sz) - sz -= esz; - else - sz = 0; + vm_size_t pgs[KERNEL_REGION_MAX_TLB_ENTRIES]; + vm_size_t mapped, pgsz, base, mask; + int idx, nents; + + /* Round up to the next 1M */ + size = (size + (1 << 20) - 1) & ~((1 << 20) - 1); + + mapped = 0; + idx = 0; + base = va; + pgsz = 64*1024*1024; + while (mapped < size) { + while (mapped < size && idx < KERNEL_REGION_MAX_TLB_ENTRIES) { + while (pgsz > (size - mapped)) + pgsz >>= 2; + pgs[idx++] = pgsz; + mapped += pgsz; + } + + /* We under-map. Correct for this. */ + if (mapped < size) { + while (pgs[idx - 1] == pgsz) { + idx--; + mapped -= pgsz; + } + /* XXX We may increase beyond out starting point. */ + pgsz <<= 2; + pgs[idx++] = pgsz; + mapped += pgsz; + } } - /* Sort entry sizes, required to get proper entry address alignment. */ - qsort(entry_size, KERNEL_REGION_MAX_TLB_ENTRIES, - sizeof(vm_size_t), tlb1_entry_size_cmp); - - /* Load TLB1 entries. */ - for (i = 0; i < KERNEL_REGION_MAX_TLB_ENTRIES; i++) { - esz = entry_size[i]; - if (!esz) - break; - - CTR5(KTR_PMAP, "%s: entry %d: sz = 0x%08x (va = 0x%08x " - "pa = 0x%08x)", __func__, tlb1_idx, esz, va, pa); - - tlb1_set_entry(va, pa, esz, _TLB_ENTRY_MEM); - - va += esz; - pa += esz; + nents = idx; + mask = pgs[0] - 1; + /* Align address to the boundary */ + if (va & mask) { + va = (va + mask) & ~mask; + pa = (pa + mask) & ~mask; } - CTR3(KTR_PMAP, "%s: mapped size 0x%08x (wasted space 0x%08x)", - __func__, mapped_size, mapped_size - size); + for (idx = 0; idx < nents; idx++) { + pgsz = pgs[idx]; + debugf("%u: %x -> %x, size=%x\n", idx, pa, va, pgsz); + tlb1_set_entry(va, pa, pgsz, _TLB_ENTRY_MEM); + pa += pgsz; + va += pgsz; + } - return (mapped_size); + mapped = (va - base); + debugf("mapped size 0x%08x (wasted space 0x%08x)\n", + mapped, mapped - size); + return (mapped); } /* @@ -3017,19 +3013,39 @@ tlb1_mapin_region(vm_offset_t va, vm_off void tlb1_init(vm_offset_t ccsrbar) { - uint32_t mas0; + uint32_t mas0, mas1, mas3; + uint32_t tsz; + u_int i; - /* TLB1[0] is used to map the kernel. Save that entry. */ - mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(0); - mtspr(SPR_MAS0, mas0); - __asm __volatile("isync; tlbre"); + if (bootinfo != NULL && bootinfo[0] != 1) { + tlb1_idx = *((uint16_t *)(bootinfo + 8)); + } else + tlb1_idx = 1; + + /* The first entry/entries are used to map the kernel. */ + for (i = 0; i < tlb1_idx; i++) { + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i); + mtspr(SPR_MAS0, mas0); + __asm __volatile("isync; tlbre"); - tlb1[0].mas1 = mfspr(SPR_MAS1); - tlb1[0].mas2 = mfspr(SPR_MAS2); - tlb1[0].mas3 = mfspr(SPR_MAS3); + mas1 = mfspr(SPR_MAS1); + if ((mas1 & MAS1_VALID) == 0) + continue; + + mas3 = mfspr(SPR_MAS3); + + tlb1[i].mas1 = mas1; + tlb1[i].mas2 = mfspr(SPR_MAS2); + tlb1[i].mas3 = mas3; + + if (i == 0) + kernload = mas3 & MAS3_RPN; + + tsz = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; + kernsize += (tsz > 0) ? tsize2size(tsz) : 0; + } - /* Map in CCSRBAR in TLB1[1] */ - tlb1_idx = 1; + /* Map in CCSRBAR. */ tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO); /* Setup TLB miss defaults */ From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 17:49:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46A811065670; Tue, 2 Aug 2011 17:49:28 +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 1CA578FC15; Tue, 2 Aug 2011 17:49:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72HnSlc062319; Tue, 2 Aug 2011 17:49:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72HnRMf062315; Tue, 2 Aug 2011 17:49:27 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108021749.p72HnRMf062315@svn.freebsd.org> From: Attilio Rao Date: Tue, 2 Aug 2011 17:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224612 - in head/sys: arm/arm arm/sa11x0 mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 17:49:28 -0000 Author: attilio Date: Tue Aug 2 17:49:27 2011 New Revision: 224612 URL: http://svn.freebsd.org/changeset/base/224612 Log: Fix for arm and mips case the size of storage for sintrcnt/sintrnames. It seems that "info as" is not much precise on what expect by pseudo-op .word, by the way. No MFC is previewed for this patch. Tested by: andreast, pluknet Approved by: re (kib) Modified: head/sys/arm/arm/irq_dispatch.S head/sys/arm/sa11x0/sa11x0_irq.S head/sys/mips/mips/exception.S Modified: head/sys/arm/arm/irq_dispatch.S ============================================================================== --- head/sys/arm/arm/irq_dispatch.S Tue Aug 2 15:35:43 2011 (r224611) +++ head/sys/arm/arm/irq_dispatch.S Tue Aug 2 17:49:27 2011 (r224612) @@ -109,9 +109,9 @@ _C_LABEL(intrnames): _C_LABEL(intrcnt): .space NIRQ * 4 _C_LABEL(sintrnames): - .word NIRQ * (MAXCOMLEN + 1) + .int NIRQ * (MAXCOMLEN + 1) _C_LABEL(sintrcnt): - .word NIRQ * 4 + .int NIRQ * 4 .global _C_LABEL(current_intr_depth) _C_LABEL(current_intr_depth): Modified: head/sys/arm/sa11x0/sa11x0_irq.S ============================================================================== --- head/sys/arm/sa11x0/sa11x0_irq.S Tue Aug 2 15:35:43 2011 (r224611) +++ head/sys/arm/sa11x0/sa11x0_irq.S Tue Aug 2 17:49:27 2011 (r224612) @@ -122,7 +122,7 @@ ENTRY(sa11x0_activateirqs) .global _C_LABEL(intrnames), _C_LABEL(sintrnames) _C_LABEL(intrnames): _C_LABEL(sintrnames): - .word 0 + .int 0 .globl _C_LABEL(intrcnt), _C_LABEL(sintrcnt) Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Tue Aug 2 15:35:43 2011 (r224611) +++ head/sys/mips/mips/exception.S Tue Aug 2 17:49:27 2011 (r224612) @@ -1143,7 +1143,7 @@ sintrnames: #ifdef __mips_n64 .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 #else - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .int INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 #endif .align 4 @@ -1153,7 +1153,7 @@ sintrcnt: #ifdef __mips_n64 .quad INTRCNT_COUNT * 4 * 2 #else - .word INTRCNT_COUNT * 4 * 2 + .int INTRCNT_COUNT * 4 * 2 #endif From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 18:12:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27A9E106564A; Tue, 2 Aug 2011 18:12:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16AEE8FC08; Tue, 2 Aug 2011 18:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72ICJLB063042; Tue, 2 Aug 2011 18:12:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72ICJih063040; Tue, 2 Aug 2011 18:12:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108021812.p72ICJih063040@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 2 Aug 2011 18:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224613 - head/sys/i386/ibcs2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 18:12:20 -0000 Author: kib Date: Tue Aug 2 18:12:19 2011 New Revision: 224613 URL: http://svn.freebsd.org/changeset/base/224613 Log: Corrections for the iBCS2 support that seems to regressed from 4.x times. In particular: - fix format specifiers in the DPRINTFs; - do not use kernel_map for temporal mapping backed by the vnode, this cannot work since kernel map is a system map. Use exec_map instead. - ignore error code from an attempt to insert the hole. If supposed hole is located at the region already populated by .bss, it is not an error. - correctly translate vm error codes to errno, when appropriate. Reported and tested by: Rich Naill Approved by: re (kensmith) MFC after: 1 week Modified: head/sys/i386/ibcs2/imgact_coff.c Modified: head/sys/i386/ibcs2/imgact_coff.c ============================================================================== --- head/sys/i386/ibcs2/imgact_coff.c Tue Aug 2 17:49:27 2011 (r224612) +++ head/sys/i386/ibcs2/imgact_coff.c Tue Aug 2 18:12:19 2011 (r224613) @@ -91,9 +91,10 @@ load_coff_section(struct vmspace *vmspac map_len = round_page(offset + filsz) - trunc_page(map_offset); } - DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08lx, 0x%x, 0x%x, " + DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08jx, 0x%x, 0x%x, " "VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, 0x%x)\n", - __FILE__, __LINE__, map_addr, map_len, prot, map_offset)); + __FILE__, __LINE__, (uintmax_t)map_addr, map_len, prot, + map_offset)); if ((error = vm_mmap(&vmspace->vm_map, &map_addr, @@ -123,16 +124,16 @@ load_coff_section(struct vmspace *vmspac map_addr = trunc_page((vm_offset_t)vmaddr + filsz); map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr; - DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx,0x%x, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", __FILE__, __LINE__, map_addr, map_len)); + DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08jx,0x%x, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", __FILE__, __LINE__, (uintmax_t)map_addr, map_len)); if (map_len != 0) { error = vm_map_find(&vmspace->vm_map, NULL, 0, &map_addr, - map_len, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0); + map_len, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); if (error) - return error; + return (vm_mmap_to_errno(error)); } - if ((error = vm_mmap(kernel_map, + if ((error = vm_mmap(exec_map, (vm_offset_t *) &data_buf, PAGE_SIZE, VM_PROT_READ, @@ -145,7 +146,7 @@ load_coff_section(struct vmspace *vmspac error = copyout(data_buf, (caddr_t) map_addr, copy_len); - if (vm_map_remove(kernel_map, + if (vm_map_remove(exec_map, (vm_offset_t) data_buf, (vm_offset_t) data_buf + PAGE_SIZE)) panic("load_coff_section vm_map_remove failed"); @@ -213,7 +214,7 @@ coff_load_file(struct thread *td, char * */ VOP_UNLOCK(vp, 0); - if ((error = vm_mmap(kernel_map, + if ((error = vm_mmap(exec_map, (vm_offset_t *) &ptr, PAGE_SIZE, VM_PROT_READ, @@ -279,7 +280,7 @@ coff_load_file(struct thread *td, char * error = 0; dealloc_and_fail: - if (vm_map_remove(kernel_map, + if (vm_map_remove(exec_map, (vm_offset_t) ptr, (vm_offset_t) ptr + PAGE_SIZE)) panic("%s vm_map_remove failed", __func__); @@ -306,7 +307,7 @@ exec_coff_imgact(imgp) unsigned long text_offset = 0, text_address = 0, text_size = 0; unsigned long data_offset = 0, data_address = 0, data_size = 0; unsigned long bss_size = 0; - caddr_t hole; + vm_offset_t hole; if (fhdr->f_magic != I386_COFF || !(fhdr->f_flags & F_EXEC)) { @@ -343,9 +344,9 @@ exec_coff_imgact(imgp) for (i = 0; i < nscns; i++) { - DPRINTF(("i = %d, scns[i].s_name = %s, scns[i].s_vaddr = %08lx, " - "scns[i].s_scnptr = %d\n", i, scns[i].s_name, - scns[i].s_vaddr, scns[i].s_scnptr)); + DPRINTF(("i = %d, s_name = %s, s_vaddr = %08lx, " + "s_scnptr = %ld s_size = %lx\n", i, scns[i].s_name, + scns[i].s_vaddr, scns[i].s_scnptr, scns[i].s_size)); if (scns[i].s_flags & STYP_NOLOAD) { /* * A section that is not loaded, for whatever @@ -372,12 +373,12 @@ exec_coff_imgact(imgp) int len = round_page(scns[i].s_size + PAGE_SIZE); int j; - if ((error = vm_mmap(kernel_map, + if ((error = vm_mmap(exec_map, (vm_offset_t *) &buf, len, VM_PROT_READ, VM_PROT_READ, - 0, + MAP_SHARED, OBJT_VNODE, imgp->vp, foff)) != 0) { @@ -411,12 +412,16 @@ exec_coff_imgact(imgp) error = coff_load_file( FIRST_THREAD_IN_PROC(imgp->proc), libname); - if (error) + if (error) { + printf( + "error %d loading coff shared library %s\n", + error, libname); break; + } } free(libbuf, M_TEMP); } - if (vm_map_remove(kernel_map, + if (vm_map_remove(exec_map, (vm_offset_t) buf, (vm_offset_t) buf + len)) panic("exec_coff_imgact vm_map_remove failed"); @@ -429,7 +434,7 @@ exec_coff_imgact(imgp) */ DPRINTF(("%s(%d): load_coff_section(vmspace, " - "imgp->vp, %08lx, %08lx, 0x%x, 0x%x, 0x%x)\n", + "imgp->vp, %08lx, %08lx, 0x%lx, 0x%lx, 0x%x)\n", __FILE__, __LINE__, text_offset, text_address, text_size, text_size, VM_PROT_READ | VM_PROT_EXECUTE)); if ((error = load_coff_section(vmspace, imgp->vp, @@ -446,7 +451,7 @@ exec_coff_imgact(imgp) DPRINTF(("%s(%d): load_coff_section(vmspace, " - "imgp->vp, 0x%08lx, 0x%08lx, 0x%x, 0x%x, 0x%x)\n", + "imgp->vp, 0x%08lx, 0x%08lx, 0x%lx, 0x%lx, 0x%x)\n", __FILE__, __LINE__, data_offset, data_address, data_size + bss_size, data_size, VM_PROT_ALL)); if ((error = load_coff_section(vmspace, imgp->vp, @@ -467,26 +472,25 @@ exec_coff_imgact(imgp) vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)text_address; vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t)data_address; - hole = (caddr_t)trunc_page((vm_offset_t)vmspace->vm_daddr) + ctob(vmspace->vm_dsize); - + hole = trunc_page((vm_offset_t)vmspace->vm_daddr + + ctob(vmspace->vm_dsize)); - DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", - __FILE__, __LINE__, hole)); + DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%jx, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", + __FILE__, __LINE__, (uintmax_t)hole)); DPRINTF(("imgact: error = %d\n", error)); - error = vm_map_find(&vmspace->vm_map, NULL, 0, - (vm_offset_t *) &hole, PAGE_SIZE, FALSE, - VM_PROT_ALL, VM_PROT_ALL, 0); - - DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%x end = 0x%x\n", + vm_map_find(&vmspace->vm_map, NULL, 0, + (vm_offset_t *)&hole, PAGE_SIZE, VMFS_NO_SPACE, + VM_PROT_ALL, VM_PROT_ALL, 0); + DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%p end = 0x%p\n", ctob(vmspace->vm_dsize), vmspace->vm_daddr, ctob(vmspace->vm_dsize) + vmspace->vm_daddr )); - DPRINTF(("%s(%d): returning successfully!\n", __FILE__, __LINE__)); + DPRINTF(("%s(%d): returning %d!\n", __FILE__, __LINE__, error)); fail: vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); - return error; + return (error); } /* From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 19:13:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D030106566B; Tue, 2 Aug 2011 19:13:57 +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 126888FC23; Tue, 2 Aug 2011 19:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72JDudM064948; Tue, 2 Aug 2011 19:13:56 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72JDun2064946; Tue, 2 Aug 2011 19:13:56 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108021913.p72JDun2064946@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Aug 2011 19:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224614 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 19:13:57 -0000 Author: mm Date: Tue Aug 2 19:13:56 2011 New Revision: 224614 URL: http://svn.freebsd.org/changeset/base/224614 Log: For mount, discover f_mntonname from supplied path argument using vn_fullpath_global(). This fixes f_mntonname if mounting inside chroot, jail or with relative path as argument. For unmount in jail, use vn_fullpath_global() to discover global path from supplied path argument. This fixes unmount in jail. Reviewed by: pjd, kib Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Tue Aug 2 18:12:19 2011 (r224613) +++ head/sys/kern/vfs_mount.c Tue Aug 2 19:13:56 2011 (r224614) @@ -745,7 +745,6 @@ static int vfs_domount_first( struct thread *td, /* Calling thread. */ struct vfsconf *vfsp, /* File system type. */ - char *fspath, /* Mount path. */ struct vnode *vp, /* Vnode to be covered. */ int fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ @@ -754,12 +753,25 @@ vfs_domount_first( struct vattr va; struct mount *mp; struct vnode *newdp; + char *fspath, *fbuf; int error; mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); + /* Construct global filesystem path from vp. */ + error = vn_fullpath_global(td, vp, &fspath, &fbuf); + if (error != 0) { + vput(vp); + return (error); + } + if (strlen(fspath) >= MNAMELEN) { + vput(vp); + free(fbuf, M_TEMP); + return (ENAMETOOLONG); + } + /* * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. @@ -781,12 +793,14 @@ vfs_domount_first( } if (error != 0) { vput(vp); + free(fbuf, M_TEMP); return (error); } VOP_UNLOCK(vp, 0); /* Allocate and initialize the filesystem. */ mp = vfs_mount_alloc(vp, vfsp, fspath, td->td_ucred); + free(fbuf, M_TEMP); /* XXXMAC: pass to vfs_mount_alloc? */ mp->mnt_optnew = *optlist; /* Set the mount level flags. */ @@ -1069,12 +1083,10 @@ vfs_domount( mtx_lock(&Giant); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - if ((fsflags & MNT_UPDATE) == 0) { - error = vfs_domount_first(td, vfsp, fspath, vp, fsflags, - optlist); - } else { + if ((fsflags & MNT_UPDATE) == 0) + error = vfs_domount_first(td, vfsp, vp, fsflags, optlist); + else error = vfs_domount_update(td, vp, fsflags, optlist); - } mtx_unlock(&Giant); ASSERT_VI_UNLOCKED(vp, __func__); @@ -1105,7 +1117,8 @@ unmount(td, uap) } */ *uap; { struct mount *mp; - char *pathbuf; + struct nameidata nd; + char *pathbuf, *rpathbuf, *fbuf; int error, id0, id1; AUDIT_ARG_VALUE(uap->flags); @@ -1140,6 +1153,28 @@ unmount(td, uap) mtx_unlock(&mountlist_mtx); } else { AUDIT_ARG_UPATH1(td, pathbuf); + /* + * If we are jailed and this is not a root jail try to find + * global path for path argument. + */ + if (jailed(td->td_ucred) && + td->td_ucred->cr_prison->pr_root != rootvnode) { + NDINIT(&nd, LOOKUP, + FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + UIO_SYSSPACE, pathbuf, td); + if (namei(&nd) == 0) { + NDFREE(&nd, NDF_ONLY_PNBUF); + if (vn_fullpath_global(td, nd.ni_vp, &rpathbuf, + &fbuf) == 0) { + if (strlen(rpathbuf) < MNAMELEN) { + strlcpy(pathbuf, rpathbuf, + MNAMELEN); + } + free(fbuf, M_TEMP); + } + vput(nd.ni_vp); + } + } mtx_lock(&mountlist_mtx); TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) { if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 19:44:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB153106566C; Tue, 2 Aug 2011 19:44:40 +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 C084D8FC15; Tue, 2 Aug 2011 19:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72JieQ8065881; Tue, 2 Aug 2011 19:44:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72JiesA065878; Tue, 2 Aug 2011 19:44:40 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108021944.p72JiesA065878@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Aug 2011 19:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224615 - in head: sys/kern usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 19:44:41 -0000 Author: mm Date: Tue Aug 2 19:44:40 2011 New Revision: 224615 URL: http://svn.freebsd.org/changeset/base/224615 Log: Always disable mount and unmount for jails with enforce_statfs==2. A working statfs(2) is required for umount(8) in jail. Reviewed by: pjd, kib Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/kern/kern_jail.c head/usr.sbin/jail/jail.8 Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Aug 2 19:13:56 2011 (r224614) +++ head/sys/kern/kern_jail.c Tue Aug 2 19:44:40 2011 (r224615) @@ -3858,7 +3858,8 @@ prison_priv_check(struct ucred *cred, in case PRIV_VFS_UNMOUNT: case PRIV_VFS_MOUNT_NONUSER: case PRIV_VFS_MOUNT_OWNER: - if (cred->cr_prison->pr_allow & PR_ALLOW_MOUNT) + if (cred->cr_prison->pr_allow & PR_ALLOW_MOUNT && + cred->cr_prison->pr_enforce_statfs < 2) return (0); else return (EPERM); Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Tue Aug 2 19:13:56 2011 (r224614) +++ head/usr.sbin/jail/jail.8 Tue Aug 2 19:44:40 2011 (r224615) @@ -393,6 +393,9 @@ The .Xr lsvfs 1 command can be used to find file system types available for mount from within a jail. +This permission is effective only if +.Va enforce_statfs +is set to a value lower than 2. .It Va allow.quotas The prison root may administer quotas on the jail's filesystem(s). This includes filesystems that the jail may share with other jails or @@ -746,9 +749,11 @@ It is not possible to or .Xr umount 8 any file system inside a jail unless the file system is marked -jail-friendly and the jail's +jail-friendly, the jail's .Va allow.mount -parameter is set. +parameter is set and the jail's +.Va enforce_statfs +parameter is lower than 2. .Pp Multiple jails sharing the same file system can influence each other. For example a user in one jail can fill the file system also From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 23:06:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7DF1065674; Tue, 2 Aug 2011 23:06:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69AEF8FC18; Tue, 2 Aug 2011 23:06:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72N6xt3075142; Tue, 2 Aug 2011 23:06:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72N6xed075140; Tue, 2 Aug 2011 23:06:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108022306.p72N6xed075140@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 2 Aug 2011 23:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224616 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 23:06:59 -0000 Author: marcel Date: Tue Aug 2 23:06:59 2011 New Revision: 224616 URL: http://svn.freebsd.org/changeset/base/224616 Log: There's no ':' after GLOBAL(). Missed due to no SMP testing. Approved by: re (blanket) Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Aug 2 19:44:40 2011 (r224615) +++ head/sys/powerpc/booke/locore.S Tue Aug 2 23:06:59 2011 (r224616) @@ -242,7 +242,7 @@ done_mapping: __boot_page: bl 1f -GLOBAL(kernload_ap): +GLOBAL(kernload_ap) .long 0 /* From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 23:33:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96D7D1065679; Tue, 2 Aug 2011 23:33:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85E7B8FC0A; Tue, 2 Aug 2011 23:33:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72NXi24075991; Tue, 2 Aug 2011 23:33:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72NXiGT075989; Tue, 2 Aug 2011 23:33:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108022333.p72NXiGT075989@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 2 Aug 2011 23:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224617 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 23:33:44 -0000 Author: marcel Date: Tue Aug 2 23:33:44 2011 New Revision: 224617 URL: http://svn.freebsd.org/changeset/base/224617 Log: It's invalid to use GLOBAL() for kernload_ap, as the macro switches to the .data section. We need kernload_ap in the boot page. Approved by: re (blanket) Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Aug 2 23:06:59 2011 (r224616) +++ head/sys/powerpc/booke/locore.S Tue Aug 2 23:33:44 2011 (r224617) @@ -242,7 +242,8 @@ done_mapping: __boot_page: bl 1f -GLOBAL(kernload_ap) + .globl kernload_ap +kernload_ap: .long 0 /* From owner-svn-src-head@FreeBSD.ORG Tue Aug 2 23:49:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C442D1065672; Tue, 2 Aug 2011 23:49:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B34698FC12; Tue, 2 Aug 2011 23:49:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p72NnNhh076485; Tue, 2 Aug 2011 23:49:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p72NnN1Q076483; Tue, 2 Aug 2011 23:49:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108022349.p72NnN1Q076483@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 2 Aug 2011 23:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224618 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 23:49:23 -0000 Author: marcel Date: Tue Aug 2 23:49:23 2011 New Revision: 224618 URL: http://svn.freebsd.org/changeset/base/224618 Log: Cross a T and dot an I: o Fix awkward use of braces in combination with mis-indentation. A mistake, that happened to yield the right behaviour? o Fix typo in comment. No functional change. Approved by: re (blanket) Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Tue Aug 2 23:33:44 2011 (r224617) +++ head/sys/powerpc/booke/platform_bare.c Tue Aug 2 23:49:23 2011 (r224618) @@ -178,13 +178,14 @@ bare_timebase_freq(platform_t plat, stru phandle_t cpus, child; pcell_t freq; - if (bootinfo != NULL) + if (bootinfo != NULL) { if (bootinfo[0] == 1) { /* Backward compatibility. See 8-STABLE. */ ticks = bootinfo[3] >> 3; } else { - /* Compatbility with Juniper's loader. */ + /* Compatibility with Juniper's loader. */ ticks = bootinfo[5] >> 3; + } } else ticks = 0; From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 06:51:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3C41106566B; Wed, 3 Aug 2011 06:51:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 932678FC0C; Wed, 3 Aug 2011 06:51:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p736pE2b090352; Wed, 3 Aug 2011 06:51:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p736pELx090350; Wed, 3 Aug 2011 06:51:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030651.p736pELx090350@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 06:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224624 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 06:51:14 -0000 Author: adrian Date: Wed Aug 3 06:51:14 2011 New Revision: 224624 URL: http://svn.freebsd.org/changeset/base/224624 Log: Remove the EEPROM minor >= 19 check for txgaintype; that's only needed for Merlin / v14 eeprom formats. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Wed Aug 3 04:28:16 2011 (r224623) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Wed Aug 3 06:51:14 2011 (r224624) @@ -75,8 +75,7 @@ v4kEepromGet(struct ath_hal *ah, int par case AR_EEP_RXGAIN_TYPE: return AR5416_EEP_RXGAIN_ORIG; case AR_EEP_TXGAIN_TYPE: - return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? - pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; + return pBase->txGainType; case AR_EEP_OL_PWRCTRL: HALASSERT(val == AH_NULL); return HAL_EIO; From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 09:56:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B585106564A; Wed, 3 Aug 2011 09:56:00 +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 0B4D58FC19; Wed, 3 Aug 2011 09:56:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p739txZA096068; Wed, 3 Aug 2011 09:55:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p739tx8n096066; Wed, 3 Aug 2011 09:55:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201108030955.p739tx8n096066@svn.freebsd.org> From: Andriy Gapon Date: Wed, 3 Aug 2011 09:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224632 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 09:56:00 -0000 Author: avg Date: Wed Aug 3 09:55:59 2011 New Revision: 224632 URL: http://svn.freebsd.org/changeset/base/224632 Log: fix a serious bug in libproc's proc_attach proc_attach always frees any struct proc_handle data that it allocates, but that is supposed to be done only in error conditions. PR: bin/158431 Approved by: re (kib) MFC after: 1 week Modified: head/lib/libproc/proc_create.c Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Wed Aug 3 09:42:48 2011 (r224631) +++ head/lib/libproc/proc_create.c Wed Aug 3 09:55:59 2011 (r224632) @@ -79,12 +79,11 @@ proc_attach(pid_t pid, int flags, struct else phdl->status = PS_STOP; +out: if (error) proc_free(phdl); else *pphdl = phdl; -out: - proc_free(phdl); return (error); } From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 13:36:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5EEA106566B; Wed, 3 Aug 2011 13:36:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B65178FC0C; Wed, 3 Aug 2011 13:36:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73DaESY015556; Wed, 3 Aug 2011 13:36:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73DaEbJ015554; Wed, 3 Aug 2011 13:36:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108031336.p73DaEbJ015554@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 13:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224633 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 13:36:14 -0000 Author: adrian Date: Wed Aug 3 13:36:14 2011 New Revision: 224633 URL: http://svn.freebsd.org/changeset/base/224633 Log: * Fix a clash in structure naming which occurs with (closed source) radar detection code. This is just to make porting the atheros radar code easier. * add a missing space. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Aug 3 09:55:59 2011 (r224632) +++ head/sys/dev/ath/ath_hal/ah.h Wed Aug 3 13:36:14 2011 (r224633) @@ -751,14 +751,14 @@ typedef enum { #define HAL_DFS_EVENT_EXTEARLY 0x0000004 #define HAL_DFS_EVENT_ISDC 0x0000008 -struct dfs_event { +struct hal_dfs_event { uint64_t re_full_ts; /* 64-bit full timestamp from interrupt time */ uint32_t re_ts; /* Original 15 bit recv timestamp */ uint8_t re_rssi; /* rssi of radar event */ uint8_t re_dur; /* duration of radar pulse */ uint32_t re_flags; /* Flags (see above) */ }; -typedef struct dfs_event HAL_DFS_EVENT; +typedef struct hal_dfs_event HAL_DFS_EVENT; typedef struct { @@ -769,7 +769,7 @@ typedef struct int ah_dma_beacon_response_time;/* in TU's */ int ah_sw_beacon_response_time; /* in TU's */ int ah_additional_swba_backoff; /* in TU's */ -}HAL_OPS_CONFIG; +} HAL_OPS_CONFIG; /* * Hardware Access Layer (HAL) API. From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 13:39:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2EE31065670; Wed, 3 Aug 2011 13:39:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7F0F8FC1F; Wed, 3 Aug 2011 13:39:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73DdBnm015689; Wed, 3 Aug 2011 13:39:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73DdBKr015685; Wed, 3 Aug 2011 13:39:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108031339.p73DdBKr015685@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 13:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224634 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 13:39:12 -0000 Author: adrian Date: Wed Aug 3 13:39:11 2011 New Revision: 224634 URL: http://svn.freebsd.org/changeset/base/224634 Log: Add in a dirty hack that allows for AR9280/AR9285/AR9287 embedded systems, in the same way that AR9130 embedded systems work. This isn't -everything- that is required - the PCI glue still needs to be taught about the eepromdata hint, along the same lines as the AHB glue. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Aug 3 13:36:14 2011 (r224633) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Aug 3 13:39:11 2011 (r224634) @@ -28,6 +28,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9001/ar9130_eeprom.h" + #include "ar9002/ar9280v1.ini" #include "ar9002/ar9280v2.ini" #include "ar9002/ar9280_olc.h" @@ -191,6 +193,12 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; + if (eepromdata) { + AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n", Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 3 13:36:14 2011 (r224633) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 3 13:39:11 2011 (r224634) @@ -29,6 +29,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9001/ar9130_eeprom.h" + #include "ar9002/ar9285.ini" #include "ar9002/ar9285v2.ini" #include "ar9002/ar9280v2.ini" /* XXX ini for tx/rx gain */ @@ -153,7 +155,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_writeIni = ar9285WriteIni; AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; - + + if (eepromdata) { + AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1; if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Aug 3 13:36:14 2011 (r224633) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Aug 3 13:39:11 2011 (r224634) @@ -30,6 +30,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ar9001/ar9130_eeprom.h" + #include "ar9002/ar9287_cal.h" #include "ar9002/ar9287_reset.h" #include "ar9002/ar9287_olc.h" @@ -168,6 +170,12 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_rx_chainmask = AR9287_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9287_DEFAULT_TXCHAINMASK; + if (eepromdata) { + AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; + AH_PRIVATE((ah))->ah_eepromWrite = NULL; + ah->ah_eepromdata = eepromdata; + } + if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n", From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 18:50:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D66BC1065670; Wed, 3 Aug 2011 18:50:19 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C81F88FC26; Wed, 3 Aug 2011 18:50:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73IoJ2g025307; Wed, 3 Aug 2011 18:50:19 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73IoJ9f025305; Wed, 3 Aug 2011 18:50:19 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108031850.p73IoJ9f025305@svn.freebsd.org> From: Zack Kirsch Date: Wed, 3 Aug 2011 18:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224637 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 18:50:19 -0000 Author: zack Date: Wed Aug 3 18:50:19 2011 New Revision: 224637 URL: http://svn.freebsd.org/changeset/base/224637 Log: Fix an NFS server issue where it was not correctly setting the eof flag when a READ had hit the end of the file. Also, clean up some cruft in the code. Approved by: re (kib) Reviewed by: rmacklem MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Wed Aug 3 18:11:53 2011 (r224636) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Wed Aug 3 18:50:19 2011 (r224637) @@ -620,7 +620,7 @@ nfsrvd_read(struct nfsrv_descript *nd, _ vnode_t vp, NFSPROC_T *p, struct nfsexstuff *exp) { u_int32_t *tl; - int error = 0, cnt, len, getret = 1, reqlen, eof = 0; + int error = 0, cnt, getret = 1, reqlen, eof = 0; mbuf_t m2, m3; struct nfsvattr nva; off_t off = 0x0; @@ -714,11 +714,11 @@ nfsrvd_read(struct nfsrv_descript *nd, _ eof = 1; } else if (reqlen == 0) cnt = 0; - else if ((off + reqlen) > nva.na_size) + else if ((off + reqlen) >= nva.na_size) { cnt = nva.na_size - off; - else + eof = 1; + } else cnt = reqlen; - len = NFSM_RNDUP(cnt); m3 = NULL; if (cnt > 0) { nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, p, @@ -748,7 +748,7 @@ nfsrvd_read(struct nfsrv_descript *nd, _ *tl++ = txdr_unsigned(cnt); } else NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - if (len < reqlen || eof) + if (eof) *tl++ = newnfs_true; else *tl++ = newnfs_false; From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 19:14:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8491065670; Wed, 3 Aug 2011 19:14:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D43F8FC12; Wed, 3 Aug 2011 19:14:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73JENOx026088; Wed, 3 Aug 2011 19:14:23 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73JEMeh026068; Wed, 3 Aug 2011 19:14:22 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201108031914.p73JEMeh026068@svn.freebsd.org> From: Brooks Davis Date: Wed, 3 Aug 2011 19:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224638 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 19:14:23 -0000 Author: brooks Date: Wed Aug 3 19:14:22 2011 New Revision: 224638 URL: http://svn.freebsd.org/changeset/base/224638 Log: Add support for dynamically adjusted buffers to allow the full use of the bandwidth of long fat pipes (i.e. 100Mbps+ trans-oceanic or trans-continental links). Bandwidth-delay products up to 64MB are supported. Also add support (not compiled by default) for the None cypher. The None cypher can only be enabled on non-interactive sessions (those without a pty where -T was not used) and must be enabled in both the client and server configuration files and on the client command line. Additionally, the None cypher will only be activated after authentication is complete. To enable the None cypher you must add -DNONE_CIPHER_ENABLED to CFLAGS via the make command line or in /etc/make.conf. This code is a style(9) compliant version of these features extracted from the patches published at: http://www.psc.edu/networking/projects/hpn-ssh/ Merging this patch has been a collaboration between me and Bjoern. Reviewed by: bz Approved by: re (kib), des (maintainer) Added: head/crypto/openssh/README.hpn Modified: head/crypto/openssh/buffer.c head/crypto/openssh/buffer.h head/crypto/openssh/channels.c head/crypto/openssh/channels.h head/crypto/openssh/cipher.c head/crypto/openssh/clientloop.c head/crypto/openssh/compat.c head/crypto/openssh/compat.h head/crypto/openssh/kex.c head/crypto/openssh/kex.h head/crypto/openssh/misc.c head/crypto/openssh/misc.h head/crypto/openssh/myproposal.h head/crypto/openssh/packet.c head/crypto/openssh/packet.h head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/serverloop.c head/crypto/openssh/session.c head/crypto/openssh/sftp.1 head/crypto/openssh/sftp.c head/crypto/openssh/ssh.c head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/version.c head/crypto/openssh/version.h Added: head/crypto/openssh/README.hpn ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssh/README.hpn Wed Aug 3 19:14:22 2011 (r224638) @@ -0,0 +1,120 @@ +Notes: + +NONE CIPHER: + To use the NONE option you must have the NoneEnabled switch set on the server + and you MUST have *both* NoneEnabled and NoneSwitch set to yes on the client. + The NONE feature works with ALL ssh subsystems (as far as we can tell) + as long as there is no tty allocated. + If a user uses the -T switch to prevent a tty being created the NONE cipher + will be disabled. + + +PERFORMANCE: + The performance increase will only be as good as the network and TCP stack + tuning on the reciever side of the connection allows. As a rule of thumb a + user will need at least 10Mb/s connection with a 100ms RTT to see a doubling + of performance. + The HPN-SSH home page http://www.psc.edu/networking/projects/hpn-ssh + describes this in greater detail. + + +BUFFER SIZES: +- if HPN is disabled the receive buffer size will be set to the OpenSSH default + of 64K. + +- if a HPN system connects to a non-HPN system the receive buffer will + be set to the HPNBufferSize value. The default is 2MB but user adjustable. + +- If a HPN to HPN connection is established a number of different things might + happen based on the user options and conditions. + + Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = up to 64MB + This is the default state. The HPN buffer size will grow to a maximum of + 64MB as the TCP receive buffer grows. The maximum HPN Buffer size of 64MB + is geared towards 10GigE transcontinental connections. + + Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = TCP receive buffer value. + Users on non-autotuning systesm should disable TCPRcvBufPoll in the + ssh_cofig and sshd_config + + Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = minmum of TCP receive buffer and HPNBufferSize. + This would be the system defined TCP receive buffer (RWIN). + + Conditions: HPNBufferSize SET, TCPRcvBufPoll disabled, TCPRcvBuf SET + Result: HPN Buffer Size = minmum of TCPRcvBuf and HPNBufferSize. + Generally there is no need to set both. + + Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf NOT Set + Result: HPN Buffer Size = grows to HPNBufferSize + The buffer will grow up to the maximum size specified here. + + Conditions: HPNBufferSize SET, TCPRcvBufPoll enabled, TCPRcvBuf SET + Result: HPN Buffer Size = minmum of TCPRcvBuf and HPNBufferSize. + Generally there is no need to set both of these, especially on autotuning + systems. However, if the users wishes to override the autotuning this would + be one way to do it. + + Conditions: HPNBufferSize NOT Set, TCPRcvBufPoll enabled, TCPRcvBuf SET + Result: HPN Buffer Size = TCPRcvBuf. + This will override autotuning and set the TCP recieve buffer to the user + defined value. + + +HPN SPECIFIC CONFIGURATION OPTIONS: + +- HPNDisabled=[yes/no] client/server + In some situations, such as transfers on a local area network, the impact + of the HPN code produces a net decrease in performance. In these cases it is + helpful to disable the HPN functionality. By default HPNDisabled is set to no. + +- HPNBufferSize=[int]KB client/server + This is the default buffer size the HPN functionality uses when interacting + with non-HPN SSH installations. Conceptually this is similar to the TcpRcvBuf + option as applied to the internal SSH flow control. This value can range from + 1KB to 64MB (1-65536). Use of oversized or undersized buffers can cause + performance problems depending on the roud trip time of the network path. + The default size of this buffer is 2MB. + +- TcpRcvBufPoll=[yes/no] client/server + Enable or disable the polling of the TCP receive buffer through the life + of the connection. You would want to make sure that this option is enabled + for systems making use of autotuning kernels (linux 2.4.24+, 2.6, MS Vista, + FreeBSD 7.x and later). Default is yes. + +- TcpRcvBuf=[int]KB client + Set the TCP socket receive buffer to n Kilobytes. It can be set up to the + maximum socket size allowed by the system. This is useful in situations where + the TCP receive window is set low but the maximum buffer size is set higher + (as is typical). This works on a per TCP connection basis. You can also use + this to artifically limit the transfer rate of the connection. In these cases + the throughput will be no more than n/RTT. The minimum buffer size is 1KB. + Default is the current system wide TCP receive buffer size. + +- NoneEnabled=[yes/no] client/server + Enable or disable the use of the None cipher. Care must always be used when + enabling this as it will allow users to send data in the clear. However, it + is important to note that authentication information remains encrypted even + if this option is enabled. Set to no by default. + +- NoneSwitch=[yes/no] client + Switch the encryption cipher being used to the None cipher after + authentication takes place. NoneEnabled must be enabled on both the client + and server side of the connection. When the connection switches to the NONE + cipher a warning is sent to STDERR. The connection attempt will fail with an + error if a client requests a NoneSwitch from the server that does not + explicitly have NoneEnabled set to yes. + Note: The NONE cipher cannot be used in interactive (shell) sessions and it + will fail silently. Set to no by default. + + +CREDITS: + + This patch was conceived, designed, and led by Chris Rapier (rapier@psc.edu) + The majority of the actual coding for versions up to HPN12v1 was performed + by Michael Stevens (mstevens@andrew.cmu.edu). + The MT-AES-CTR cipher was implemented by Ben Bennet (ben@psc.edu). + This work was financed, in part, by Cisco System, Inc., the National Library + of Medicine, and the National Science Foundation. Modified: head/crypto/openssh/buffer.c ============================================================================== --- head/crypto/openssh/buffer.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/buffer.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: buffer.c,v 1.32 2010/02/09 03:56:28 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -25,7 +26,7 @@ #include "log.h" #define BUFFER_MAX_CHUNK 0x100000 -#define BUFFER_MAX_LEN 0xa00000 +#define BUFFER_MAX_LEN 0x4000000 /* 64MB */ #define BUFFER_ALLOCSZ 0x008000 /* Initializes the buffer structure. */ @@ -165,6 +166,13 @@ buffer_len(const Buffer *buffer) return buffer->end - buffer->offset; } +/* Returns the maximum number of bytes of data that may be in the buffer. */ +u_int +buffer_get_max_len(void) +{ + return (BUFFER_MAX_LEN); +} + /* Gets data from the beginning of the buffer. */ int Modified: head/crypto/openssh/buffer.h ============================================================================== --- head/crypto/openssh/buffer.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/buffer.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: buffer.h,v 1.21 2010/08/31 11:54:45 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -46,6 +47,8 @@ int buffer_get_ret(Buffer *, void *, u_ int buffer_consume_ret(Buffer *, u_int); int buffer_consume_end_ret(Buffer *, u_int); +u_int buffer_get_max_len(void); + #include void buffer_put_bignum(Buffer *, const BIGNUM *); Modified: head/crypto/openssh/channels.c ============================================================================== --- head/crypto/openssh/channels.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/channels.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: channels.c,v 1.310 2010/11/24 01:24:14 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -170,6 +171,11 @@ static void port_open_helper(Channel *c, static int connect_next(struct channel_connect *); static void channel_connect_ctx_free(struct channel_connect *); +/* -- HPN */ + +static int hpn_disabled = 0; +static u_int buffer_size = CHAN_HPN_MIN_WINDOW_DEFAULT; + /* -- channel core */ Channel * @@ -309,6 +315,7 @@ channel_new(char *ctype, int type, int r c->self = found; c->type = type; c->ctype = ctype; + c->dynamic_window = 0; c->local_window = window; c->local_window_max = window; c->local_consumed = 0; @@ -808,11 +815,46 @@ channel_pre_open_13(Channel *c, fd_set * FD_SET(c->sock, writeset); } +static u_int +channel_tcpwinsz(void) +{ + u_int32_t tcpwinsz; + socklen_t optsz; + int ret, sd; + u_int maxlen; + + /* If we are not on a socket return 128KB. */ + if (!packet_connection_is_on_socket()) + return (128 * 1024); + + tcpwinsz = 0; + optsz = sizeof(tcpwinsz); + sd = packet_get_connection_in(); + ret = getsockopt(sd, SOL_SOCKET, SO_RCVBUF, &tcpwinsz, &optsz); + + /* Return no more than the maximum buffer size. */ + maxlen = buffer_get_max_len(); + if ((ret == 0) && tcpwinsz > maxlen) + tcpwinsz = maxlen; + /* In case getsockopt() failed return a minimum. */ + if (tcpwinsz == 0) + tcpwinsz = CHAN_TCP_WINDOW_DEFAULT; + debug2("tcpwinsz: %d for connection: %d", tcpwinsz, sd); + return (tcpwinsz); +} + static void channel_pre_open(Channel *c, fd_set *readset, fd_set *writeset) { - u_int limit = compat20 ? c->remote_window : packet_get_maxsize(); + u_int limit; + /* Check buffer limits. */ + if (!c->tcpwinsz || c->dynamic_window > 0) + c->tcpwinsz = channel_tcpwinsz(); + + limit = MIN(compat20 ? c->remote_window : packet_get_maxsize(), + 2 * c->tcpwinsz); + if (c->istate == CHAN_INPUT_OPEN && limit > 0 && buffer_len(&c->input) < limit && @@ -1789,14 +1831,25 @@ channel_check_window(Channel *c) c->local_maxpacket*3) || c->local_window < c->local_window_max/2) && c->local_consumed > 0) { + u_int addition = 0; + + /* Adjust max window size if we are in a dynamic environment. */ + if (c->dynamic_window && c->tcpwinsz > c->local_window_max) { + /* + * Grow the window somewhat aggressively to maintain + * pressure. + */ + addition = 1.5 * (c->tcpwinsz - c->local_window_max); + c->local_window_max += addition; + } packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); packet_put_int(c->remote_id); - packet_put_int(c->local_consumed); + packet_put_int(c->local_consumed + addition); packet_send(); debug2("channel %d: window %d sent adjust %d", c->self, c->local_window, c->local_consumed); - c->local_window += c->local_consumed; + c->local_window += c->local_consumed + addition; c->local_consumed = 0; } return 1; @@ -2634,6 +2687,15 @@ channel_set_af(int af) IPv4or6 = af; } +void +channel_set_hpn(int disabled, u_int buf_size) +{ + hpn_disabled = disabled; + buffer_size = buf_size; + debug("HPN Disabled: %d, HPN Buffer Size: %d", + hpn_disabled, buffer_size); +} + static int channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_port, int *allocated_listen_port, @@ -2786,10 +2848,18 @@ channel_setup_fwd_listener(int type, con *allocated_listen_port); } - /* Allocate a channel number for the socket. */ - c = channel_new("port listener", type, sock, sock, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, - 0, "port listener", 1); + /* + * Allocate a channel number for the socket. Explicitly test + * for hpn disabled option. If true use smaller window size. + */ + if (hpn_disabled) + c = channel_new("port listener", type, sock, sock, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, + 0, "port listener", 1); + else + c = channel_new("port listener", type, sock, sock, -1, + buffer_size, CHAN_TCP_PACKET_DEFAULT, + 0, "port listener", 1); c->path = xstrdup(host); c->host_port = port_to_connect; c->listening_port = listen_port; @@ -3334,10 +3404,16 @@ x11_create_display_inet(int x11_display_ *chanids = xcalloc(num_socks + 1, sizeof(**chanids)); for (n = 0; n < num_socks; n++) { sock = socks[n]; - nc = channel_new("x11 listener", - SSH_CHANNEL_X11_LISTENER, sock, sock, -1, - CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, - 0, "X11 inet listener", 1); + if (hpn_disabled) + nc = channel_new("x11 listener", + SSH_CHANNEL_X11_LISTENER, sock, sock, -1, + CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, + 0, "X11 inet listener", 1); + else + nc = channel_new("x11 listener", + SSH_CHANNEL_X11_LISTENER, sock, sock, -1, + buffer_size, CHAN_X11_PACKET_DEFAULT, + 0, "X11 inet listener", 1); nc->single_connection = single_connection; (*chanids)[n] = nc->self; } Modified: head/crypto/openssh/channels.h ============================================================================== --- head/crypto/openssh/channels.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/channels.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: channels.h,v 1.104 2010/05/14 23:29:23 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -125,6 +126,8 @@ struct Channel { u_int local_window_max; u_int local_consumed; u_int local_maxpacket; + u_int tcpwinsz; + int dynamic_window; int extended_usage; int single_connection; @@ -162,11 +165,15 @@ struct Channel { /* default window/packet sizes for tcp/x11-fwd-channel */ #define CHAN_SES_PACKET_DEFAULT (32*1024) #define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT) + #define CHAN_TCP_PACKET_DEFAULT (32*1024) #define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT) + #define CHAN_X11_PACKET_DEFAULT (16*1024) #define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT) +#define CHAN_HPN_MIN_WINDOW_DEFAULT (2*1024*1024) + /* possible input states */ #define CHAN_INPUT_OPEN 0 #define CHAN_INPUT_WAIT_DRAIN 1 @@ -294,4 +301,7 @@ void chan_rcvd_ieof(Channel *); void chan_write_failed(Channel *); void chan_obuf_empty(Channel *); +/* hpn handler */ +void channel_set_hpn(int, u_int); + #endif Modified: head/crypto/openssh/cipher.c ============================================================================== --- head/crypto/openssh/cipher.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/cipher.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: cipher.c,v 1.82 2009/01/26 09:58:15 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -163,7 +164,12 @@ ciphers_valid(const char *names) for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0'; (p = strsep(&cp, CIPHER_SEP))) { c = cipher_by_name(p); - if (c == NULL || c->number != SSH_CIPHER_SSH2) { +#ifdef NONE_CIPHER_ENABLED + if (c == NULL || (c->number != SSH_CIPHER_SSH2 && + c->number != SSH_CIPHER_NONE)) { +#else + if (c == NULL || (c->number != SSH_CIPHER_SSH2)) { +#endif debug("bad cipher %s [%s]", p, names); xfree(cipher_list); return 0; @@ -337,6 +343,9 @@ cipher_get_keyiv(CipherContext *cc, u_ch int evplen; switch (c->number) { +#ifdef NONE_CIPHER_ENABLED + case SSH_CIPHER_NONE: +#endif case SSH_CIPHER_SSH2: case SSH_CIPHER_DES: case SSH_CIPHER_BLOWFISH: @@ -371,6 +380,9 @@ cipher_set_keyiv(CipherContext *cc, u_ch int evplen = 0; switch (c->number) { +#ifdef NONE_CIPHER_ENABLED + case SSH_CIPHER_NONE: +#endif case SSH_CIPHER_SSH2: case SSH_CIPHER_DES: case SSH_CIPHER_BLOWFISH: Modified: head/crypto/openssh/clientloop.c ============================================================================== --- head/crypto/openssh/clientloop.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/clientloop.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: clientloop.c,v 1.231 2011/01/16 12:05:59 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1768,9 +1769,14 @@ client_request_x11(const char *request_t sock = x11_connect_display(); if (sock < 0) return NULL; - c = channel_new("x11", - SSH_CHANNEL_X11_OPEN, sock, sock, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1); + if (options.hpn_disabled) + c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, + 0, "x11", 1); + else + c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1, + options.hpn_buffer_size, CHAN_X11_PACKET_DEFAULT, + 0, "x11", 1); c->force_drain = 1; return c; } @@ -1790,10 +1796,16 @@ client_request_agent(const char *request sock = ssh_get_authentication_socket(); if (sock < 0) return NULL; - c = channel_new("authentication agent connection", - SSH_CHANNEL_OPEN, sock, sock, -1, - CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, - "authentication agent connection", 1); + if (options.hpn_disabled) + c = channel_new("authentication agent connection", + SSH_CHANNEL_OPEN, sock, sock, -1, + CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0, + "authentication agent connection", 1); + else + c = channel_new("authentication agent connection", + SSH_CHANNEL_OPEN, sock, sock, -1, + options.hpn_buffer_size, options.hpn_buffer_size, 0, + "authentication agent connection", 1); c->force_drain = 1; return c; } @@ -1820,8 +1832,14 @@ client_request_tun_fwd(int tun_mode, int return -1; } - c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1); + if (options.hpn_disabled) + c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, + 0, "tun", 1); + else + c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, + options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT, + 0, "tun", 1); c->datagram = 1; #if defined(SSH_TUN_FILTER) Modified: head/crypto/openssh/compat.c ============================================================================== --- head/crypto/openssh/compat.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/compat.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: compat.c,v 1.78 2008/09/11 14:22:37 markus Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -170,6 +171,16 @@ compat_datafellows(const char *version) strlen(check[i].pat), 0) == 1) { debug("match: %s pat %s", version, check[i].pat); datafellows = check[i].bugs; + /* + * Check to see if the remote side is OpenSSH and not + * HPN. It is utterly strange to check it from the + * version string and expose the option that way. + */ + if (strstr(version,"OpenSSH") != NULL && + strstr(version,"hpn") == NULL) { + datafellows |= SSH_BUG_LARGEWINDOW; + debug("Remote is not HPN-aware"); + } return; } } Modified: head/crypto/openssh/compat.h ============================================================================== --- head/crypto/openssh/compat.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/compat.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: compat.h,v 1.42 2008/09/11 14:22:37 markus Exp $ */ +/* $FReeBSD$ */ /* * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. @@ -58,6 +59,7 @@ #define SSH_OLD_FORWARD_ADDR 0x01000000 #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 +#define SSH_BUG_LARGEWINDOW 0x08000000 void enable_compat13(void); void enable_compat20(void); Modified: head/crypto/openssh/kex.c ============================================================================== --- head/crypto/openssh/kex.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/kex.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: kex.c,v 1.86 2010/09/22 05:01:29 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * @@ -90,8 +91,13 @@ kex_names_valid(const char *names) return 1; } -/* put algorithm proposal into buffer */ +/* Put algorithm proposal into buffer. */ +#ifndef NONE_CIPHER_ENABLED static void +#else +/* Also used in sshconnect2.c. */ +void +#endif kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX]) { u_int i; @@ -407,6 +413,9 @@ kex_choose_conf(Kex *kex) int nenc, nmac, ncomp; u_int mode, ctos, need; int first_kex_follows, type; +#ifdef NONE_CIPHER_ENABLED + int auth_flag; +#endif my = kex_buf2prop(&kex->my, NULL); peer = kex_buf2prop(&kex->peer, &first_kex_follows); @@ -430,6 +439,10 @@ kex_choose_conf(Kex *kex) } /* Algorithm Negotiation */ +#ifdef NONE_CIPHER_ENABLED + auth_flag = packet_get_authentication_state(); + debug ("AUTH STATE is %d", auth_flag); +#endif for (mode = 0; mode < MODE_MAX; mode++) { newkeys = xcalloc(1, sizeof(*newkeys)); kex->newkeys[mode] = newkeys; @@ -441,6 +454,17 @@ kex_choose_conf(Kex *kex) choose_enc (&newkeys->enc, cprop[nenc], sprop[nenc]); choose_mac (&newkeys->mac, cprop[nmac], sprop[nmac]); choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]); +#ifdef NONE_CIPHER_ENABLED + debug("REQUESTED ENC.NAME is '%s'", newkeys->enc.name); + if (strcmp(newkeys->enc.name, "none") == 0) { + debug("Requesting NONE. Authflag is %d", auth_flag); + if (auth_flag == 1) + debug("None requested post authentication."); + else + fatal("Pre-authentication none cipher requests " + "are not allowed."); + } +#endif debug("kex: %s %s %s %s", ctos ? "client->server" : "server->client", newkeys->enc.name, Modified: head/crypto/openssh/kex.h ============================================================================== --- head/crypto/openssh/kex.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/kex.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: kex.h,v 1.52 2010/09/22 05:01:29 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -140,6 +141,10 @@ struct Kex { int kex_names_valid(const char *); +#ifdef NONE_CIPHER_ENABLED +void kex_prop2buf(Buffer *, char *[PROPOSAL_MAX]); +#endif + Kex *kex_setup(char *[PROPOSAL_MAX]); void kex_finish(Kex *); Modified: head/crypto/openssh/misc.c ============================================================================== --- head/crypto/openssh/misc.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/misc.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: misc.c,v 1.84 2010/11/21 01:01:13 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -996,3 +997,34 @@ sock_set_v6only(int s) error("setsockopt IPV6_V6ONLY: %s", strerror(errno)); #endif } + +void +sock_get_rcvbuf(int *size, int rcvbuf) +{ + int sock, socksize; + socklen_t socksizelen = sizeof(socksize); + + /* + * Create a socket but do not connect it. We use it + * only to get the rcv socket size. + */ + sock = socket(AF_INET6, SOCK_STREAM, 0); + if (sock < 0) + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0) + return; + + /* + * If the tcp_rcv_buf option is set and passed in, attempt to set the + * buffer size to its value. + */ + if (rcvbuf) + setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf, + sizeof(rcvbuf)); + + if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, + &socksize, &socksizelen) == 0) + if (size != NULL) + *size = socksize; + close(sock); +} Modified: head/crypto/openssh/misc.h ============================================================================== --- head/crypto/openssh/misc.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/misc.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: misc.h,v 1.47 2010/11/21 01:01:13 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -36,6 +37,7 @@ void sanitise_stdfd(void); void ms_subtract_diff(struct timeval *, int *); void ms_to_timeval(struct timeval *, int); void sock_set_v6only(int); +void sock_get_rcvbuf(int *, int); struct passwd *pwcopy(struct passwd *); const char *ssh_gai_strerror(int); Modified: head/crypto/openssh/myproposal.h ============================================================================== --- head/crypto/openssh/myproposal.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/myproposal.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: myproposal.h,v 1.27 2010/09/01 22:42:13 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -75,6 +76,10 @@ "arcfour256,arcfour128," \ "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \ "aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se" +#ifdef NONE_CIPHER_ENABLED +#define KEX_ENCRYPT_INCLUDE_NONE KEX_DEFAULT_ENCRYPT \ + ",none" +#endif #define KEX_DEFAULT_MAC \ "hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160," \ "hmac-ripemd160@openssh.com," \ Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/packet.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: packet.c,v 1.172 2010/11/13 23:27:50 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -195,6 +196,9 @@ struct session_state { }; static struct session_state *active_state, *backup_state; +#ifdef NONE_CIPHER_ENABLED +static int rekey_requested = 0; +#endif static struct session_state * alloc_session_state(void) @@ -1861,12 +1865,26 @@ packet_send_ignore(int nbytes) } } +#ifdef NONE_CIPHER_ENABLED +void +packet_request_rekeying(void) +{ + rekey_requested = 1; +} +#endif + #define MAX_PACKETS (1U<<31) int packet_need_rekeying(void) { if (datafellows & SSH_BUG_NOREKEY) return 0; +#ifdef NONE_CIPHER_ENABLED + if (rekey_requested == 1) { + rekey_requested = 0; + return 1; + } +#endif return (active_state->p_send.packets > MAX_PACKETS) || (active_state->p_read.packets > MAX_PACKETS) || @@ -1958,3 +1976,11 @@ packet_restore_state(void) add_recv_bytes(len); } } + +#ifdef NONE_CIPHER_ENABLED +int +packet_get_authentication_state(void) +{ + return (active_state->after_authentication); +} +#endif Modified: head/crypto/openssh/packet.h ============================================================================== --- head/crypto/openssh/packet.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/packet.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: packet.h,v 1.55 2010/11/13 23:27:50 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -38,6 +39,9 @@ void packet_set_interactive(int, int int packet_is_interactive(void); void packet_set_server(void); void packet_set_authenticated(void); +#ifdef NONE_CIPHER_ENABLED +int packet_get_authentication_state(void); +#endif void packet_start(u_char); void packet_put_char(int ch); @@ -117,6 +121,9 @@ do { \ } while (0) int packet_need_rekeying(void); +#ifdef NONE_CIPHER_ENABLED +void packet_request_rekeying(void); +#endif void packet_set_rekey_limit(u_int32_t); void packet_backup_state(void); Modified: head/crypto/openssh/readconf.c ============================================================================== --- head/crypto/openssh/readconf.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/readconf.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: readconf.c,v 1.190 2010/11/13 23:27:50 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -138,6 +139,10 @@ typedef enum { oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand, oVisualHostKey, oUseRoaming, oZeroKnowledgePasswordAuthentication, oKexAlgorithms, oIPQoS, + oHPNDisabled, oHPNBufferSize, oTcpRcvBufPoll, oTcpRcvBuf, +#ifdef NONE_CIPHER_ENABLED + oNoneEnabled, oNoneSwitch, +#endif oVersionAddendum, oDeprecated, oUnsupported } OpCodes; @@ -249,6 +254,14 @@ static struct { #endif { "kexalgorithms", oKexAlgorithms }, { "ipqos", oIPQoS }, + { "hpndisabled", oHPNDisabled }, + { "hpnbuffersize", oHPNBufferSize }, + { "tcprcvbufpoll", oTcpRcvBufPoll }, + { "tcprcvbuf", oTcpRcvBuf }, +#ifdef NONE_CIPHER_ENABLED + { "noneenabled", oNoneEnabled }, + { "noneswitch", oNoneSwitch }, +#endif { "versionaddendum", oVersionAddendum }, { NULL, oBadOption } @@ -1021,6 +1034,47 @@ parse_int: } while (arg != NULL && *arg != '\0'); break; + case oHPNDisabled: + intptr = &options->hpn_disabled; + goto parse_flag; + + case oHPNBufferSize: + intptr = &options->hpn_buffer_size; + goto parse_int; + + case oTcpRcvBufPoll: + intptr = &options->tcp_rcv_buf_poll; + goto parse_flag; + + case oTcpRcvBuf: + intptr = &options->tcp_rcv_buf; + goto parse_int; + +#ifdef NONE_CIPHER_ENABLED + case oNoneEnabled: + intptr = &options->none_enabled; + goto parse_flag; + + /* + * We check to see if the command comes from the command line or not. + * If it does then enable it otherwise fail. NONE must never be a + * default configuration. + */ + case oNoneSwitch: + if (strcmp(filename,"command-line") == 0) { + intptr = &options->none_switch; + goto parse_flag; + } else { + debug("NoneSwitch directive found in %.200s.", + filename); + error("NoneSwitch is found in %.200s.\n" + "You may only use this configuration option " + "from the command line", filename); + error("Continuing..."); + return 0; + } +#endif + case oDeprecated: debug("%s line %d: Deprecated option \"%s\"", filename, linenum, keyword); @@ -1181,6 +1235,14 @@ initialize_options(Options * options) options->zero_knowledge_password_authentication = -1; options->ip_qos_interactive = -1; options->ip_qos_bulk = -1; + options->hpn_disabled = -1; + options->hpn_buffer_size = -1; + options->tcp_rcv_buf_poll = -1; + options->tcp_rcv_buf = -1; +#ifdef NONE_CIPHER_ENABLED + options->none_enabled = -1; + options->none_switch = -1; +#endif } /* @@ -1345,6 +1407,36 @@ fill_default_options(Options * options) /* options->hostname will be set in the main program if appropriate */ /* options->host_key_alias should not be set by default */ /* options->preferred_authentications will be set in ssh */ + if (options->hpn_disabled == -1) + options->hpn_disabled = 0; + if (options->hpn_buffer_size > -1) + { + u_int maxlen; + + /* If a user tries to set the size to 0 set it to 1KB. */ + if (options->hpn_buffer_size == 0) + options->hpn_buffer_size = 1024; + /* Limit the buffer to BUFFER_MAX_LEN. */ + maxlen = buffer_get_max_len(); + if (options->hpn_buffer_size > (maxlen / 1024)) { + debug("User requested buffer larger than %ub: %ub. " + "Request reverted to %ub", maxlen, + options->hpn_buffer_size * 1024, maxlen); + options->hpn_buffer_size = maxlen; + } + debug("hpn_buffer_size set to %d", options->hpn_buffer_size); + } + if (options->tcp_rcv_buf == 0) + options->tcp_rcv_buf = 1; + if (options->tcp_rcv_buf > -1) + options->tcp_rcv_buf *= 1024; + if (options->tcp_rcv_buf_poll == -1) + options->tcp_rcv_buf_poll = 1; +#ifdef NONE_CIPHER_ENABLED + /* options->none_enabled must not be set by default */ + if (options->none_switch == -1) + options->none_switch = 0; +#endif } /* Modified: head/crypto/openssh/readconf.h ============================================================================== --- head/crypto/openssh/readconf.h Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/readconf.h Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: readconf.h,v 1.88 2010/11/13 23:27:50 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -132,6 +133,17 @@ typedef struct { int use_roaming; + int hpn_disabled; /* Switch to disable HPN buffer management. */ + int hpn_buffer_size; /* User definable size for HPN buffer + * window. */ + int tcp_rcv_buf_poll; /* Option to poll recv buf every window + * transfer. */ + int tcp_rcv_buf; /* User switch to set tcp recv buffer. */ + +#ifdef NONE_CIPHER_ENABLED + int none_enabled; /* Allow none to be used */ + int none_switch; /* Use none cipher */ +#endif } Options; #define SSHCTL_MASTER_NO 0 Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Wed Aug 3 18:50:19 2011 (r224637) +++ head/crypto/openssh/servconf.c Wed Aug 3 19:14:22 2011 (r224638) @@ -1,4 +1,5 @@ /* $OpenBSD: servconf.c,v 1.213 2010/11/13 23:27:50 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -141,6 +142,12 @@ initialize_server_options(ServerOptions options->authorized_principals_file = NULL; options->ip_qos_interactive = -1; options->ip_qos_bulk = -1; + options->hpn_disabled = -1; + options->hpn_buffer_size = -1; + options->tcp_rcv_buf_poll = -1; +#ifdef NONE_CIPHER_ENABLED + options->none_enabled = -1; +#endif } void @@ -283,6 +290,37 @@ fill_default_server_options(ServerOption options->ip_qos_interactive = IPTOS_LOWDELAY; if (options->ip_qos_bulk == -1) options->ip_qos_bulk = IPTOS_THROUGHPUT; + if (options->hpn_disabled == -1) + options->hpn_disabled = 0; + if (options->hpn_buffer_size == -1) { + /* + * HPN buffer size option not explicitly set. Try to figure + * out what value to use or resort to default. + */ + options->hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT; + if (!options->hpn_disabled) { + sock_get_rcvbuf(&options->hpn_buffer_size, 0); + debug ("HPN Buffer Size: %d", options->hpn_buffer_size); + } + } else { + /* + * In the case that the user sets both values in a + * contradictory manner hpn_disabled overrrides hpn_buffer_size. + */ + if (options->hpn_disabled <= 0) { + u_int maxlen; + + maxlen = buffer_get_max_len(); + if (options->hpn_buffer_size == 0) + options->hpn_buffer_size = 1; + /* Limit the maximum buffer to BUFFER_MAX_LEN. */ + if (options->hpn_buffer_size > maxlen / 1024) + options->hpn_buffer_size = maxlen; + else + options->hpn_buffer_size *= 1024; + } else + options->hpn_buffer_size = CHAN_TCP_WINDOW_DEFAULT; + } /* Turn privilege separation on by default */ if (use_privsep == -1) @@ -330,6 +368,10 @@ typedef enum { sZeroKnowledgePasswordAuthentication, sHostCertificate, sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, sKexAlgorithms, sIPQoS, + sHPNDisabled, sHPNBufferSize, sTcpRcvBufPoll, +#ifdef NONE_CIPHER_ENABLED + sNoneEnabled, +#endif sVersionAddendum, sDeprecated, sUnsupported } ServerOpCodes; @@ -455,6 +497,12 @@ static struct { { "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL }, { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 19:26:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADEC1106566C; Wed, 3 Aug 2011 19:26:57 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FC0F8FC15; Wed, 3 Aug 2011 19:26:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73JQvLq026515; Wed, 3 Aug 2011 19:26:57 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73JQvwv026513; Wed, 3 Aug 2011 19:26:57 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201108031926.p73JQvwv026513@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 3 Aug 2011 19:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224639 - head/usr.bin/catman X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 19:26:57 -0000 Author: uqs Date: Wed Aug 3 19:26:57 2011 New Revision: 224639 URL: http://svn.freebsd.org/changeset/base/224639 Log: Unbreak catman(1) by removing calls to col(1). col(1) was mangling the SGR escapes and is not strictly required. See r222647, r222648, r222650, and r222653 for more details. Reported by: delphij Reviewed by: ru Approved by: re (kib) MFC after: 3 weeks Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Wed Aug 3 19:14:22 2011 (r224638) +++ head/usr.bin/catman/catman.c Wed Aug 3 19:26:57 2011 (r224639) @@ -432,7 +432,7 @@ process_page(char *mandir, char *src, ch } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp", + "%scat %s | tbl | nroff -T%s -man | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", src, nroff_device, zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 20:00:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8717106564A; Wed, 3 Aug 2011 20:00:36 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4DA8FC08; Wed, 3 Aug 2011 20:00:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73K0aaC027604; Wed, 3 Aug 2011 20:00:36 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73K0an9027603; Wed, 3 Aug 2011 20:00:36 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201108032000.p73K0an9027603@svn.freebsd.org> From: Brooks Davis Date: Wed, 3 Aug 2011 20:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224640 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 20:00:37 -0000 Author: brooks Date: Wed Aug 3 20:00:36 2011 New Revision: 224640 URL: http://svn.freebsd.org/changeset/base/224640 Log: Enable keyword expansion for $FreeBSD$ on files where it was added it r224638. Submitted by: bz Approved by: re (implicit) Point hat to: brooks Modified: Directory Properties: head/crypto/openssh/buffer.c (props changed) head/crypto/openssh/buffer.h (props changed) head/crypto/openssh/channels.c (props changed) head/crypto/openssh/channels.h (props changed) head/crypto/openssh/cipher.c (props changed) head/crypto/openssh/clientloop.c (props changed) head/crypto/openssh/compat.c (props changed) head/crypto/openssh/kex.c (props changed) head/crypto/openssh/kex.h (props changed) head/crypto/openssh/misc.c (props changed) head/crypto/openssh/misc.h (props changed) head/crypto/openssh/myproposal.h (props changed) head/crypto/openssh/packet.c (props changed) head/crypto/openssh/packet.h (props changed) head/crypto/openssh/readconf.h (props changed) head/crypto/openssh/serverloop.c (props changed) head/crypto/openssh/sftp.c (props changed) head/crypto/openssh/sshconnect2.c (props changed) From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 20:21:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9547A1065672; Wed, 3 Aug 2011 20:21:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856428FC14; Wed, 3 Aug 2011 20:21:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73KL0W3028291; Wed, 3 Aug 2011 20:21:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73KL0sH028281; Wed, 3 Aug 2011 20:21:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201108032021.p73KL0sH028281@svn.freebsd.org> From: Michael Tuexen Date: Wed, 3 Aug 2011 20:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224641 - in head: lib/libc/net sys/netinet sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 20:21:00 -0000 Author: tuexen Date: Wed Aug 3 20:21:00 2011 New Revision: 224641 URL: http://svn.freebsd.org/changeset/base/224641 Log: The result of a joint work between rrs@ and myself at the IETF: * Decouple the path supervision using a separate HB timer per path. * Add support for potentially failed state. * Bring back RTO.min to 1 second. * Accept packets on IP-addresses already announced via an ASCONF * While there: do some cleanups. Approved by: re@ MFC after: 2 months. Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed Aug 3 20:00:36 2011 (r224640) +++ head/lib/libc/net/sctp_sys_calls.c Wed Aug 3 20:21:00 2011 (r224641) @@ -410,6 +410,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_PRINFO: ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; break; + case SCTP_PEER_ADDR_THLDS: + ((struct sctp_paddrthlds *)arg)->spt_assoc_id = id; + break; case SCTP_MAX_BURST: ((struct sctp_assoc_value *)arg)->assoc_id = id; break; Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed Aug 3 20:00:36 2011 (r224640) +++ head/sys/netinet/sctp.h Wed Aug 3 20:21:00 2011 (r224641) @@ -119,6 +119,7 @@ struct sctp_paramhdr { #define SCTP_RECVNXTINFO 0x00000020 #define SCTP_DEFAULT_SNDINFO 0x00000021 #define SCTP_DEFAULT_PRINFO 0x00000022 +#define SCTP_PEER_ADDR_THLDS 0x00000023 /* * read-only options @@ -564,7 +565,6 @@ struct sctp_error_unrecognized_chunk { #define SCTP_BLK_LOGGING_ENABLE 0x00000001 #define SCTP_CWND_MONITOR_ENABLE 0x00000002 #define SCTP_CWND_LOGGING_ENABLE 0x00000004 -#define SCTP_EARLYFR_LOGGING_ENABLE 0x00000010 #define SCTP_FLIGHT_LOGGING_ENABLE 0x00000020 #define SCTP_FR_LOGGING_ENABLE 0x00000040 #define SCTP_LOCK_LOGGING_ENABLE 0x00000080 @@ -572,23 +572,23 @@ struct sctp_error_unrecognized_chunk { #define SCTP_MBCNT_LOGGING_ENABLE 0x00000200 #define SCTP_MBUF_LOGGING_ENABLE 0x00000400 #define SCTP_NAGLE_LOGGING_ENABLE 0x00000800 -#define SCTP_RECV_RWND_LOGGING_ENABLE 0x00001000 +#define SCTP_RECV_RWND_LOGGING_ENABLE 0x00001000 #define SCTP_RTTVAR_LOGGING_ENABLE 0x00002000 #define SCTP_SACK_LOGGING_ENABLE 0x00004000 -#define SCTP_SACK_RWND_LOGGING_ENABLE 0x00008000 +#define SCTP_SACK_RWND_LOGGING_ENABLE 0x00008000 #define SCTP_SB_LOGGING_ENABLE 0x00010000 #define SCTP_STR_LOGGING_ENABLE 0x00020000 #define SCTP_WAKE_LOGGING_ENABLE 0x00040000 #define SCTP_LOG_MAXBURST_ENABLE 0x00080000 #define SCTP_LOG_RWND_ENABLE 0x00100000 -#define SCTP_LOG_SACK_ARRIVALS_ENABLE 0x00200000 -#define SCTP_LTRACE_CHUNK_ENABLE 0x00400000 -#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 -#define SCTP_LAST_PACKET_TRACING 0x01000000 -#define SCTP_THRESHOLD_LOGGING 0x02000000 -#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 -#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 -#define SCTP_LOG_TRY_ADVANCE 0x10000000 +#define SCTP_LOG_SACK_ARRIVALS_ENABLE 0x00200000 +#define SCTP_LTRACE_CHUNK_ENABLE 0x00400000 +#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 +#define SCTP_LAST_PACKET_TRACING 0x01000000 +#define SCTP_THRESHOLD_LOGGING 0x02000000 +#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 +#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 +#define SCTP_LOG_TRY_ADVANCE 0x10000000 #undef SCTP_PACKED Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Wed Aug 3 20:00:36 2011 (r224640) +++ head/sys/netinet/sctp_asconf.c Wed Aug 3 20:21:00 2011 (r224641) @@ -198,8 +198,9 @@ sctp_asconf_error_response(uint32_t id, static struct mbuf * sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, - struct sctp_tcb *stcb, int response_required) + struct sctp_tcb *stcb, int send_hb, int response_required) { + struct sctp_nets *net; struct mbuf *m_reply = NULL; struct sockaddr_storage sa_source, sa_store; struct sctp_paramhdr *ph; @@ -284,7 +285,7 @@ sctp_process_asconf_add_ip(struct mbuf * SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); } /* add the address */ - if (sctp_add_remote_addr(stcb, sa, SCTP_DONOT_SETSCOPE, + if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, SCTP_ADDR_DYNAMIC_ADDED) != 0) { SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); @@ -298,10 +299,12 @@ sctp_process_asconf_add_ip(struct mbuf * m_reply = sctp_asconf_success_response(aph->correlation_id); } - sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, - NULL, SCTP_FROM_SCTP_ASCONF + SCTP_LOC_1); + sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, stcb->sctp_ep, stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, - stcb, NULL); + stcb, net); + if (send_hb) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } return m_reply; } @@ -554,7 +557,12 @@ sctp_process_asconf_set_primary(struct m "process_asconf_set_primary: primary address set\n"); /* notify upper layer */ sctp_ulp_notify(SCTP_NOTIFY_ASCONF_SET_PRIMARY, stcb, 0, sa, SCTP_SO_NOT_LOCKED); - + if ((stcb->asoc.primary_destination->dest_state & SCTP_ADDR_REACHABLE) && + (!(stcb->asoc.primary_destination->dest_state & SCTP_ADDR_PF)) && + (stcb->asoc.alternate)) { + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } if (response_required) { m_reply = sctp_asconf_success_response(aph->correlation_id); } @@ -622,7 +630,7 @@ sctp_handle_asconf(struct mbuf *m, unsig struct sctp_asconf_ack_chunk *ack_cp; struct sctp_asconf_paramhdr *aph, *ack_aph; struct sctp_ipv6addr_param *p_addr; - unsigned int asconf_limit; + unsigned int asconf_limit, cnt; int error = 0; /* did an error occur? */ /* asconf param buffer */ @@ -717,6 +725,7 @@ sctp_handle_asconf(struct mbuf *m, unsig goto send_reply; } /* process through all parameters */ + cnt = 0; while (aph != NULL) { unsigned int param_length, param_type; @@ -749,7 +758,8 @@ sctp_handle_asconf(struct mbuf *m, unsig case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; m_result = sctp_process_asconf_add_ip(m, aph, stcb, - error); + (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); + cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; @@ -1959,7 +1969,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * int status; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 && + if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 || sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* subset bound, no ASCONF allowed case, so ignore */ return; @@ -2075,8 +2085,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - addr_locked); + sctp_send_asconf(stcb, NULL, addr_locked); #endif } } @@ -2328,8 +2337,7 @@ sctp_asconf_iterator_stcb(struct sctp_in * If we have queued params in the open state, send out an ASCONF. */ if (num_queued > 0) { - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); } } @@ -2384,8 +2392,7 @@ sctp_set_primary_ip_address_sa(struct sc stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } else { @@ -2421,8 +2428,7 @@ sctp_set_primary_ip_address(struct sctp_ stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } @@ -2965,8 +2971,7 @@ sctp_process_initack_addresses(struct sc stcb->sctp_ep, stcb, stcb->asoc.primary_destination); #else - sctp_send_asconf(stcb, stcb->asoc.primary_destination, - SCTP_ADDR_NOT_LOCKED); + sctp_send_asconf(stcb, NULL, SCTP_ADDR_NOT_LOCKED); #endif } } @@ -3540,5 +3545,5 @@ sctp_asconf_send_nat_state_update(struct } skip_rest: /* Now we must send the asconf into the queue */ - sctp_send_asconf(stcb, net, 0); + sctp_send_asconf(stcb, net, SCTP_ADDR_NOT_LOCKED); } Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Aug 3 20:00:36 2011 (r224640) +++ head/sys/netinet/sctp_cc_functions.c Wed Aug 3 20:21:00 2011 (r224641) @@ -728,40 +728,6 @@ sctp_cwnd_update_after_sack_common(struc } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -769,51 +735,6 @@ sctp_cwnd_update_after_sack_common(struc } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - old_cwnd = net->cwnd; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SDT_PROBE(sctp, cwnd, net, ack, - stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, - old_cwnd, net->cwnd); - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -833,7 +754,7 @@ sctp_cwnd_update_after_sack_common(struc * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * Did any measurements go on for this network? @@ -856,7 +777,7 @@ sctp_cwnd_update_after_sack_common(struc if (net->cc_mod.rtcc.lbw) { if (cc_bw_limit(stcb, net, nbw)) { /* Hold here, no update */ - goto skip_cwnd_update; + continue; } } else { uint64_t vtag, probepoint; @@ -1049,27 +970,25 @@ sctp_cwnd_update_after_sack_common(struc SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } static void +sctp_cwnd_update_exit_pf_common(struct sctp_tcb *stcb, struct sctp_nets *net) +{ + int old_cwnd; + + old_cwnd = net->cwnd; + net->cwnd = net->mtu; + SDT_PROBE(sctp, cwnd, net, ack, + stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, + old_cwnd, net->cwnd); + SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", + net, net->cwnd); +} + + +static void sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net) { int old_cwnd = net->cwnd; @@ -1344,32 +1263,6 @@ sctp_cwnd_update_after_output(struct sct } static void -sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net) -{ - int old_cwnd = net->cwnd; - - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - /* - * make a small adjustment to cwnd and force to CA. - */ - if (net->cwnd > net->mtu) - /* drop down one MTU after sending */ - net->cwnd -= net->mtu; - if (net->cwnd < net->ssthresh) - /* still in SS move to CA */ - net->ssthresh = net->cwnd - 1; - SDT_PROBE(sctp, cwnd, net, fr, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); - } -} - -static void sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit) @@ -1858,40 +1751,6 @@ sctp_hs_cwnd_update_after_sack(struct sc } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -1899,47 +1758,6 @@ sctp_hs_cwnd_update_after_sack(struct sc } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -1959,7 +1777,7 @@ sctp_hs_cwnd_update_after_sack(struct sc * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has @@ -2004,23 +1822,6 @@ sctp_hs_cwnd_update_after_sack(struct sc SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } @@ -2340,40 +2141,6 @@ sctp_htcp_cwnd_update_after_sack(struct } } #endif - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - /* - * So, first of all do we need to have a Early FR - * timer running? - */ - if ((!TAILQ_EMPTY(&asoc->sent_queue) && - (net->ref_count > 1) && - (net->flight_size < net->cwnd)) || - (reneged_all)) { - /* - * yes, so in this case stop it if its - * running, and then restart it. Reneging - * all is a special case where we want to - * run the Early FR timer and then force the - * last few unacked to be sent, causing us - * to illicit a sack with gaps to force out - * the others. - */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck2); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_20); - } - SCTP_STAT_INCR(sctps_earlyfrstrid); - sctp_timer_start(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net); - } else { - /* No, stop it if its running */ - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck3); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_21); - } - } - } /* if nothing was acked on this destination skip it */ if (net->net_ack == 0) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { @@ -2381,47 +2148,6 @@ sctp_htcp_cwnd_update_after_sack(struct } continue; } - if (net->net_ack2 > 0) { - /* - * Karn's rule applies to clearing error count, this - * is optional. - */ - net->error_count = 0; - if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == - SCTP_ADDR_NOT_REACHABLE) { - /* addr came good */ - net->dest_state &= ~SCTP_ADDR_NOT_REACHABLE; - net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); - /* now was it the primary? if so restore */ - if (net->dest_state & SCTP_ADDR_WAS_PRIMARY) { - (void)sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net); - } - } - /* - * JRS 5/14/07 - If CMT PF is on and the destination - * is in PF state, set the destination to active - * state and set the cwnd to one or two MTU's based - * on whether PF1 or PF2 is being used. - * - * Should we stop any running T3 timer here? - */ - if ((asoc->sctp_cmt_on_off > 0) && - (asoc->sctp_cmt_pf > 0) && - ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) { - net->dest_state &= ~SCTP_ADDR_PF; - net->cwnd = net->mtu * asoc->sctp_cmt_pf; - SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); - /* - * Since the cwnd value is explicitly set, - * skip the code that updates the cwnd - * value. - */ - goto skip_cwnd_update; - } - } #ifdef JANA_CMT_FAST_RECOVERY /* * CMT fast recovery code @@ -2441,7 +2167,7 @@ sctp_htcp_cwnd_update_after_sack(struct * If we are in loss recovery we skip any cwnd * update */ - goto skip_cwnd_update; + return; } /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has @@ -2457,23 +2183,6 @@ sctp_htcp_cwnd_update_after_sack(struct SCTP_CWND_LOG_NO_CUMACK); } } -skip_cwnd_update: - /* - * NOW, according to Karn's rule do we need to restore the - * RTO timer back? Check our net_ack2. If not set then we - * have a ambiguity.. i.e. all data ack'd was sent to more - * than one place. - */ - if (net->net_ack2) { - /* restore any doubled timers */ - net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; - if (net->RTO < stcb->asoc.minrto) { - net->RTO = stcb->asoc.minrto; - } - if (net->RTO > stcb->asoc.maxrto) { - net->RTO = stcb->asoc.maxrto; - } - } } } @@ -2566,30 +2275,6 @@ sctp_htcp_cwnd_update_after_timeout(stru } static void -sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net) -{ - int old_cwnd; - - old_cwnd = net->cwnd; - - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_EARLY_FR_TMR, SCTP_SO_NOT_LOCKED); - net->cc_mod.htcp_ca.last_cong = sctp_get_tick_count(); - /* - * make a small adjustment to cwnd and force to CA. - */ - if (net->cwnd > net->mtu) - /* drop down one MTU after sending */ - net->cwnd -= net->mtu; - if (net->cwnd < net->ssthresh) - /* still in SS move to CA */ - net->ssthresh = net->cwnd - 1; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (old_cwnd - net->cwnd), SCTP_CWND_LOG_FROM_FR); - } -} - -static void sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost) { @@ -2618,42 +2303,42 @@ struct sctp_cc_functions sctp_cc_functio { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer }, { .sctp_set_initial_cc_param = sctp_set_rtcc_initial_cc_param, .sctp_cwnd_update_after_sack = sctp_cwnd_update_rtcc_after_sack, + .sctp_cwnd_update_exit_pf = sctp_cwnd_update_exit_pf_common, .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_rtcc_after_ecn_echo, .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, - .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer, .sctp_cwnd_update_packet_transmitted = sctp_cwnd_update_rtcc_packet_transmitted, .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Aug 3 20:00:36 2011 (r224640) +++ head/sys/netinet/sctp_constants.h Wed Aug 3 20:21:00 2011 (r224641) @@ -416,7 +416,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_STR_RESET_IN_REQUEST 0x000e #define SCTP_STR_RESET_TSN_REQUEST 0x000f #define SCTP_STR_RESET_RESPONSE 0x0010 -#define SCTP_STR_RESET_ADD_STREAMS 0x0011 +#define SCTP_STR_RESET_ADD_STREAMS 0x0011 #define SCTP_MAX_RESET_PARAMS 2 #define SCTP_STREAM_RESET_TSN_DELTA 0x1000 @@ -508,14 +508,10 @@ __FBSDID("$FreeBSD$"); /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 -#define SCTP_ADDR_NOT_REACHABLE 0x002 #define SCTP_ADDR_NOHB 0x004 #define SCTP_ADDR_BEING_DELETED 0x008 #define SCTP_ADDR_NOT_IN_ASSOC 0x010 -#define SCTP_ADDR_WAS_PRIMARY 0x020 -#define SCTP_ADDR_SWITCH_PRIMARY 0x040 #define SCTP_ADDR_OUT_OF_SCOPE 0x080 -#define SCTP_ADDR_DOUBLE_SWITCH 0x100 #define SCTP_ADDR_UNCONFIRMED 0x200 #define SCTP_ADDR_REQ_PRIMARY 0x400 /* JRS 5/13/07 - Added potentially failed state for CMT PF */ @@ -579,14 +575,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_TIMER_TYPE_EVENTWAKE 13 #define SCTP_TIMER_TYPE_STRRESET 14 #define SCTP_TIMER_TYPE_INPKILL 15 -#define SCTP_TIMER_TYPE_EARLYFR 17 -#define SCTP_TIMER_TYPE_ASOCKILL 18 -#define SCTP_TIMER_TYPE_ADDR_WQ 19 -#define SCTP_TIMER_TYPE_ZERO_COPY 20 -#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 21 -#define SCTP_TIMER_TYPE_PRIM_DELETED 22 +#define SCTP_TIMER_TYPE_ASOCKILL 16 +#define SCTP_TIMER_TYPE_ADDR_WQ 17 +#define SCTP_TIMER_TYPE_ZERO_COPY 18 +#define SCTP_TIMER_TYPE_ZCOPY_SENDQ 19 +#define SCTP_TIMER_TYPE_PRIM_DELETED 20 /* add new timers here - and increment LAST */ -#define SCTP_TIMER_TYPE_LAST 23 +#define SCTP_TIMER_TYPE_LAST 21 #define SCTP_IS_TIMER_TYPE_VALID(t) (((t) > SCTP_TIMER_TYPE_NONE) && \ ((t) < SCTP_TIMER_TYPE_LAST)) @@ -655,16 +650,17 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ -#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ +#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ #define SCTP_INP_KILL_TIMEOUT 20/* number of ms to retry kill of inpcb */ #define SCTP_ASOC_KILL_TIMEOUT 10 /* number of ms to retry kill of inpcb */ -#define SCTP_DEF_MAX_INIT 8 -#define SCTP_DEF_MAX_SEND 10 -#define SCTP_DEF_MAX_PATH_RTX 5 +#define SCTP_DEF_MAX_INIT 8 +#define SCTP_DEF_MAX_SEND 10 +#define SCTP_DEF_MAX_PATH_RTX 5 +#define SCTP_DEF_PATH_PF_THRESHOLD SCTP_DEF_MAX_PATH_RTX #define SCTP_DEF_PMTU_RAISE_SEC 600 /* 10 min between raise attempts */ @@ -679,7 +675,7 @@ __FBSDID("$FreeBSD$"); /* Send window update (incr * this > hiwat). Should be a power of 2 */ #define SCTP_MINIMAL_RWND (4096) /* minimal rwnd */ -#define SCTP_ADDRMAX 24 +#define SCTP_ADDRMAX 16 /* SCTP DEBUG Switch parameters */ #define SCTP_DEBUG_TIMER1 0x00000001 Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Wed Aug 3 20:00:36 2011 (r224640) +++ head/sys/netinet/sctp_header.h Wed Aug 3 20:21:00 2011 (r224641) @@ -98,9 +98,10 @@ struct sctp_heartbeat_info_param { uint32_t time_value_2; uint32_t random_value1; uint32_t random_value2; - uint16_t user_req; uint8_t addr_family; uint8_t addr_len; + /* make sure that this structure is 4 byte aligned */ + uint8_t padding[2]; char address[SCTP_ADDRMAX]; } SCTP_PACKED; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Aug 3 20:00:36 2011 (r224640) +++ head/sys/netinet/sctp_indata.c Wed Aug 3 20:21:00 2011 (r224641) @@ -2434,7 +2434,8 @@ sctp_sack_check(struct sctp_tcb *stcb, i sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } - sctp_send_shutdown(stcb, stcb->asoc.primary_destination); + sctp_send_shutdown(stcb, + ((stcb->asoc.alternate) ? stcb->asoc.alternate : stcb->asoc.primary_destination)); sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } else { int is_a_gap; @@ -4054,9 +4055,50 @@ sctp_express_handle_sack(struct sctp_tcb } /* JRS - Use the congestion control given in the CC module */ - if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) + if ((asoc->last_acked_seq != cumack) && (ecne_seen == 0)) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (net->net_ack2 > 0) { + /* + * Karn's rule applies to clearing error + * count, this is optional. + */ + net->error_count = 0; + if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { + /* addr came good */ + net->dest_state |= SCTP_ADDR_REACHABLE; + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, + SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + } + if (net == stcb->asoc.primary_destination) { + if (stcb->asoc.alternate) { + /* + * release the alternate, + * primary is good + */ + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } + } + if (net->dest_state & SCTP_ADDR_PF) { + net->dest_state &= ~SCTP_ADDR_PF; + sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); + asoc->cc_functions.sctp_cwnd_update_exit_pf(stcb, net); + /* Done with this net */ + net->net_ack = 0; + } + /* restore any doubled timers */ + net->RTO = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; + if (net->RTO < stcb->asoc.minrto) { + net->RTO = stcb->asoc.minrto; + } + if (net->RTO > stcb->asoc.maxrto) { + net->RTO = stcb->asoc.maxrto; + } + } + } asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, 1, 0, 0); - + } asoc->last_acked_seq = cumack; if (TAILQ_EMPTY(&asoc->sent_queue)) { @@ -4127,13 +4169,6 @@ again: stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_22); } - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck4); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_23); - } - } } } if ((j == 0) && @@ -4222,6 +4257,8 @@ again: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, SCTP_RESPONSE_TO_USER_REQ, oper, SCTP_SO_NOT_LOCKED); } else { + struct sctp_nets *netp; + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); @@ -4229,26 +4266,36 @@ again: SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, - stcb->asoc.primary_destination); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); } } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { + struct sctp_nets *netp; + + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, - stcb->asoc.primary_destination); + sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, - stcb->sctp_ep, stcb, asoc->primary_destination); + stcb->sctp_ep, stcb, netp); } } /*********************************************/ @@ -4380,7 +4427,7 @@ sctp_handle_sack(struct mbuf *m, int off num_dup, SCTP_LOG_NEW_SACK); } - if ((num_dup) && (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_FR_LOGGING_ENABLE | SCTP_EARLYFR_LOGGING_ENABLE))) { + if ((num_dup) && (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE)) { uint16_t i; uint32_t *dupdata, dblock; @@ -4468,13 +4515,6 @@ sctp_handle_sack(struct mbuf *m, int off TAILQ_FOREACH(net, &asoc->nets, sctp_next) { sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); - if (SCTP_BASE_SYSCTL(sctp_early_fr)) { - if (SCTP_OS_TIMER_PENDING(&net->fr_timer.timer)) { - SCTP_STAT_INCR(sctps_earlyfrstpidsck1); - sctp_timer_stop(SCTP_TIMER_TYPE_EARLYFR, stcb->sctp_ep, stcb, net, - SCTP_FROM_SCTP_INDATA + SCTP_LOC_26); - } - } net->partial_bytes_acked = 0; net->flight_size = 0; } @@ -4830,20 +4870,54 @@ sctp_handle_sack(struct mbuf *m, int off asoc->saw_sack_with_nr_frags = 0; /* JRS - Use the congestion control given in the CC module */ - if (ecne_seen == 0) + if (ecne_seen == 0) { + TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (net->net_ack2 > 0) { + /* + * Karn's rule applies to clearing error + * count, this is optional. + */ + net->error_count = 0; + if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { + /* addr came good */ + net->dest_state |= SCTP_ADDR_REACHABLE; + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, + SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + } + if (net == stcb->asoc.primary_destination) { + if (stcb->asoc.alternate) { + /* + * release the alternate, + * primary is good + */ + sctp_free_remote_addr(stcb->asoc.alternate); + stcb->asoc.alternate = NULL; + } + } + if (net->dest_state & SCTP_ADDR_PF) { + net->dest_state &= ~SCTP_ADDR_PF; + sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 20:21:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A40106566B; Wed, 3 Aug 2011 20:21:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12CFF8FC21; Wed, 3 Aug 2011 20:21:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73KLq1F028356; Wed, 3 Aug 2011 20:21:52 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73KLqIa028353; Wed, 3 Aug 2011 20:21:52 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201108032021.p73KLqIa028353@svn.freebsd.org> From: Brooks Davis Date: Wed, 3 Aug 2011 20:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224642 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 20:21:53 -0000 Author: brooks Date: Wed Aug 3 20:21:52 2011 New Revision: 224642 URL: http://svn.freebsd.org/changeset/base/224642 Log: Fix two more $FreeBSD$ keywords. Reported by: pluknet Approved by: re (implicit) Modified: head/crypto/openssh/compat.h (contents, props changed) head/crypto/openssh/servconf.h (contents, props changed) Modified: head/crypto/openssh/compat.h ============================================================================== --- head/crypto/openssh/compat.h Wed Aug 3 20:21:00 2011 (r224641) +++ head/crypto/openssh/compat.h Wed Aug 3 20:21:52 2011 (r224642) @@ -1,5 +1,5 @@ /* $OpenBSD: compat.h,v 1.42 2008/09/11 14:22:37 markus Exp $ */ -/* $FReeBSD$ */ +/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. Modified: head/crypto/openssh/servconf.h ============================================================================== --- head/crypto/openssh/servconf.h Wed Aug 3 20:21:00 2011 (r224641) +++ head/crypto/openssh/servconf.h Wed Aug 3 20:21:52 2011 (r224642) @@ -1,5 +1,5 @@ /* $OpenBSD: servconf.h,v 1.95 2010/11/13 23:27:50 djm Exp $ */ -/* $OpenBSD$ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen From owner-svn-src-head@FreeBSD.ORG Wed Aug 3 23:57:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8C96106566C; Wed, 3 Aug 2011 23:57:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFD108FC17; Wed, 3 Aug 2011 23:57:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73NvcCw035647; Wed, 3 Aug 2011 23:57:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73NvcYp035643; Wed, 3 Aug 2011 23:57:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108032357.p73NvcYp035643@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 23:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224644 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 23:57:39 -0000 Author: adrian Date: Wed Aug 3 23:57:38 2011 New Revision: 224644 URL: http://svn.freebsd.org/changeset/base/224644 Log: Undo this for now. It's "right", but it means everything will rely on the ar9130 code. Since at least one kernel config specifies individual ath HAL chips rather than just "device ath_hal" (arm/AVILA), I'm doing this so people aren't caught out when they update to -HEAD or 9.0 and discover their ath setup doesn't compile. I'll revisit this with a proper fix sometime before 9.0-RELEASE. Approved by: re (kib, blanket) Pointed out by: ray@ Pointy hat to: adrian@ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Aug 3 23:36:04 2011 (r224643) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Aug 3 23:57:38 2011 (r224644) @@ -28,8 +28,6 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" -#include "ar9001/ar9130_eeprom.h" - #include "ar9002/ar9280v1.ini" #include "ar9002/ar9280v2.ini" #include "ar9002/ar9280_olc.h" @@ -193,12 +191,6 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; - if (eepromdata) { - AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; - AH_PRIVATE((ah))->ah_eepromWrite = NULL; - ah->ah_eepromdata = eepromdata; - } - if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n", Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 3 23:36:04 2011 (r224643) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Aug 3 23:57:38 2011 (r224644) @@ -29,8 +29,6 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" -#include "ar9001/ar9130_eeprom.h" - #include "ar9002/ar9285.ini" #include "ar9002/ar9285v2.ini" #include "ar9002/ar9280v2.ini" /* XXX ini for tx/rx gain */ @@ -155,13 +153,7 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_writeIni = ar9285WriteIni; AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; - - if (eepromdata) { - AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; - AH_PRIVATE((ah))->ah_eepromWrite = NULL; - ah->ah_eepromdata = eepromdata; - } - + ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1; if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Aug 3 23:36:04 2011 (r224643) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Aug 3 23:57:38 2011 (r224644) @@ -30,8 +30,6 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" -#include "ar9001/ar9130_eeprom.h" - #include "ar9002/ar9287_cal.h" #include "ar9002/ar9287_reset.h" #include "ar9002/ar9287_olc.h" @@ -170,12 +168,6 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_rx_chainmask = AR9287_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9287_DEFAULT_TXCHAINMASK; - if (eepromdata) { - AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead; - AH_PRIVATE((ah))->ah_eepromWrite = NULL; - ah->ah_eepromdata = eepromdata; - } - if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n", From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 08:50:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A051065672; Thu, 4 Aug 2011 08:50:33 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB3538FC12; Thu, 4 Aug 2011 08:50:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p748oXo2052179; Thu, 4 Aug 2011 08:50:33 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p748oXAT052177; Thu, 4 Aug 2011 08:50:33 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108040850.p748oXAT052177@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 4 Aug 2011 08:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224648 - head/usr.bin/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 08:50:34 -0000 Author: ru Date: Thu Aug 4 08:50:33 2011 New Revision: 224648 URL: http://svn.freebsd.org/changeset/base/224648 Log: Clean up markup. Approved by: re (kib) Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Thu Aug 4 07:32:21 2011 (r224647) +++ head/usr.bin/man/man.1 Thu Aug 4 08:50:33 2011 (r224648) @@ -34,7 +34,7 @@ .Sh SYNOPSIS .Nm .Op Fl adho -.Op Fl t | Fl w +.Op Fl t | w .Op Fl M Ar manpath .Op Fl P Ar pager .Op Fl S Ar mansect @@ -73,9 +73,9 @@ environment variable. .It Fl P Ar pager Use specified pager. Defaults to -.Ic "less -sR" +.Dq Li "less -sR" if color support is enabled, or -.Ic "more -s" . +.Dq Li "more -s" . Overrides the .Ev MANPAGER environment variable, which in turn overrides the @@ -84,7 +84,7 @@ environment variable. .It Fl S Ar mansect Restricts manual sections searched to the specified colon delimited list. Defaults to -.Va 1:1aout:8:2:3:n:4:5:6:7:9:l . +.Dq Li 1:1aout:8:2:3:n:4:5:6:7:9:l . Overrides the .Ev MANSECT environment variable. @@ -125,12 +125,13 @@ Overrides the and .Ev LANG environment variables. -.It Fl p Op Ar eprtv +.It Fl p Op Cm eprtv Use the list of given preprocessors before running .Xr nroff 1 or .Xr troff 1 . Valid preprocessors arguments: +.Pp .Bl -tag -width indent -compact .It Cm e .Xr eqn 1 @@ -143,6 +144,7 @@ Valid preprocessors arguments: .It Cm v .Xr vgrind 1 .El +.Pp Overrides the .Ev MANROFFSEQ environment variable. @@ -161,35 +163,31 @@ The utility supports manual pages in different locales. The search behavior is dictated by the first of three environment variables with a nonempty string: -.Ev LC_ALL , -.Ev LC_CTYPE , +.Ev LC_ALL , LC_CTYPE , or .Ev LANG . If set, .Nm will search for locale specific manual pages using the following logic: -.Bl -item -compact -offset indent -.Sm off +.Pp +.Bl -item -offset indent -compact .It -.Va lang _ -.Va country . -.Va charset +.Va lang Ns _ Ns Va country Ns . Ns Va charset .It -.Va lang . -.Va charset +.Va lang Ns . Ns Va charset .It -.Li en . -.Va charset -.Sm on +.Li en Ns . Ns Va charset .El +.Pp For example, if .Ev LC_ALL is set to -.Va ja_JP.eucJP , +.Dq Li ja_JP.eucJP , .Nm will search the following paths when considering section 1 manual pages in .Pa /usr/share/man : -.Bl -item -compact -offset indent +.Pp +.Bl -item -offset indent -compact .It .Pa /usr/share/man/ja_JP.eucJP/man1 .It @@ -213,15 +211,16 @@ environment variables. For example, if .Ev MACHINE_ARCH is set to -.Va i386 +.Dq Li i386 and .Ev MACHINE is set to -.Va pc98 , +.Dq Li pc98 , .Nm will search the following paths when considering section 4 manual pages in .Pa /usr/share/man : -.Bl -item -compact -offset indent +.Pp +.Bl -item -offset indent -compact .It .Pa /usr/share/man/man4/pc98 .It @@ -234,12 +233,12 @@ The .Nm utility also supports displaying a specific manual page if passed a path to the file as long as it contains a -.Sq / +.Ql / character. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev MANPATH" +.Bl -tag -width ".Ev MANROFFSEQ" .It Ev LC_ALL , LC_CTYPE , LANG Used to find locale specific manual pages. Valid values can be found by running the @@ -254,9 +253,9 @@ option. .It Ev MACHINE_ARCH , MACHINE Used to find platform specific manual pages. If unset, the output of -.Ic "sysctl hw.machine_arch" +.Dq Li "sysctl hw.machine_arch" and -.Ic "sysctl hw.machine" +.Dq Li "sysctl hw.machine" is used respectively. See .Sx IMPLEMENTATION NOTES @@ -299,14 +298,14 @@ If set, enables color support. Program used to display files. .Pp If unset, and color support is enabled, -.Ic "less -sR" +.Dq Li "less -sR" is used. .Pp If unset, and color support is disabled, then .Ev PAGER is used. If that has no value either, -.Ic "more -s" +.Dq Li "more -s" is used. .El .Sh FILES @@ -317,11 +316,11 @@ System configuration file. Local configuration files. .El .Sh SEE ALSO -.Xr intro 1 , .Xr apropos 1 , +.Xr intro 1 , .Xr locale 1 , .Xr manpath 1 , -.Xr man.conf 5 , .Xr nroff 1 , .Xr troff 1 , -.Xr whatis 1 +.Xr whatis 1 , +.Xr man.conf 5 From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 14:18:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2525B1065705; Thu, 4 Aug 2011 14:18:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F00AE8FC0A; Thu, 4 Aug 2011 14:18:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p74EI9g4064611; Thu, 4 Aug 2011 14:18:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p74EI9ha064609; Thu, 4 Aug 2011 14:18:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201108041418.p74EI9ha064609@svn.freebsd.org> From: Ed Maste Date: Thu, 4 Aug 2011 14:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224650 - head/usr.bin/ar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 14:18:10 -0000 Author: emaste Date: Thu Aug 4 14:18:09 2011 New Revision: 224650 URL: http://svn.freebsd.org/changeset/base/224650 Log: Don't try to free() an address returned by mmap(). This appears to be triggered by the same .o being included twice on the command line. Found by: Nima Misaghian at Sandvine Reviewed by: kientzle, kaiw Approved by: re MFC after: 1 week Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Thu Aug 4 10:37:12 2011 (r224649) +++ head/usr.bin/ar/write.c Thu Aug 4 14:18:09 2011 (r224650) @@ -58,6 +58,7 @@ static struct ar_obj *create_obj_from_fi const char *name, time_t mtime); static void create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size); +static void free_obj(struct bsdar *bsdar, struct ar_obj *obj); static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj, struct ar_obj *pos); static void read_objs(struct bsdar *bsdar, const char *archive, @@ -210,6 +211,22 @@ giveup: } /* + * Free object itself and its associated allocations. + */ +static void +free_obj(struct bsdar *bsdar, struct ar_obj *obj) +{ + if (obj->fd == -1) + free(obj->maddr); + else + if (obj->maddr != NULL && munmap(obj->maddr, obj->size)) + bsdar_warnc(bsdar, errno, + "can't munmap file: %s", obj->name); + free(obj->name); + free(obj); +} + +/* * Insert obj to the tail, or before/after the pos obj. */ static void @@ -474,11 +491,8 @@ write_archive(struct bsdar *bsdar, char *av); TAILQ_REMOVE(&bsdar->v_obj, obj, objs); - if (mode == 'd' || mode == 'r') { - free(obj->maddr); - free(obj->name); - free(obj); - } + if (mode == 'd' || mode == 'r') + free_obj(bsdar, obj); if (mode == 'm') insert_obj(bsdar, obj, pos); @@ -525,15 +539,8 @@ write_cleanup(struct bsdar *bsdar) struct ar_obj *obj, *obj_temp; TAILQ_FOREACH_SAFE(obj, &bsdar->v_obj, objs, obj_temp) { - if (obj->fd == -1) - free(obj->maddr); - else - if (obj->maddr != NULL && munmap(obj->maddr, obj->size)) - bsdar_warnc(bsdar, errno, - "can't munmap file: %s", obj->name); TAILQ_REMOVE(&bsdar->v_obj, obj, objs); - free(obj->name); - free(obj); + free_obj(bsdar, obj); } free(bsdar->as); From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 14:20:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71282106566B; Thu, 4 Aug 2011 14:20:13 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F9358FC13; Thu, 4 Aug 2011 14:20:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p74EKDbO064709; Thu, 4 Aug 2011 14:20:13 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p74EKDJm064703; Thu, 4 Aug 2011 14:20:13 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108041420.p74EKDJm064703@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 4 Aug 2011 14:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224651 - head/tools/regression/security/cap_test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 14:20:13 -0000 Author: jonathan Date: Thu Aug 4 14:20:13 2011 New Revision: 224651 URL: http://svn.freebsd.org/changeset/base/224651 Log: Flesh out the cap_test regression test. Add more regression testing, some of which is expected to fail until we commit more kernel implementation. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/tools/regression/security/cap_test/Makefile head/tools/regression/security/cap_test/cap_test.c head/tools/regression/security/cap_test/cap_test.h head/tools/regression/security/cap_test/cap_test_capmode.c head/tools/regression/security/cap_test/cap_test_sysctl.c Modified: head/tools/regression/security/cap_test/Makefile ============================================================================== --- head/tools/regression/security/cap_test/Makefile Thu Aug 4 14:18:09 2011 (r224650) +++ head/tools/regression/security/cap_test/Makefile Thu Aug 4 14:20:13 2011 (r224651) @@ -1,9 +1,22 @@ # $FreeBSD$ PROG= cap_test -SRCS= cap_test.c cap_test_capmode.c cap_test_sysctl.c +SRCS= cap_test.c \ + cap_test_capmode.c \ + cap_test_capabilities.c \ + cap_test_fcntl.c \ + cap_test_sysctl.c WARNS= 3 NO_MAN= -CFLAGS+= -DMACHINE=\"${MACHINE}\" + +# Use headers and libc from the build, if available. +KERNCONF?= GENERIC +OBJROOT= ${.OBJDIR}/../../../../ +OBJKERN= ${OBJROOT}/sys/${KERNCONF} + +SRCROOT= ${.CURDIR}/../../../../ + +CFLAGS+= -DMACHINE=\"${MACHINE}\" -I${OBJKERN} -I${SRCROOT}/sys +LDFLAGS+= -L${OBJROOT}/lib/libc -lc .include Modified: head/tools/regression/security/cap_test/cap_test.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test.c Thu Aug 4 14:18:09 2011 (r224650) +++ head/tools/regression/security/cap_test/cap_test.c Thu Aug 4 14:20:13 2011 (r224651) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008-2011 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,19 +30,89 @@ #include __FBSDID("$FreeBSD$"); +#include + +#include +#include #include +#include +#include #include "cap_test.h" +/* Initialize a named test. Requires test_NAME() function to be declared. */ +#define TEST_INIT(name) { #name, test_##name, FAILED } + +/* All of the tests that can be run. */ +struct test all_tests[] = { + TEST_INIT(capmode), + TEST_INIT(capabilities), + TEST_INIT(fcntl), + TEST_INIT(sysctl), +}; +size_t test_count = sizeof(all_tests) / sizeof(struct test); + int main(int argc, char *argv[]) { - test_capmode(); - test_sysctl(); + /* - test_capabilities(); - test_syscalls(); - test_fcntl(); - */ - exit(0); + * If no tests have been specified at the command line, run them all. + */ + if (argc == 1) { + printf("1..%ld\n", test_count); + + for (size_t i = 0; i < test_count; i++) + execute(i + 1, all_tests + i); + return (0); + } + + /* + * Otherwise, run only the specified tests. + */ + printf("1..%d\n", argc - 1); + for (int i = 1; i < argc; i++) + { + int found = 0; + for (size_t j = 0; j < test_count; j++) { + if (strncmp(argv[i], all_tests[j].t_name, + strlen(argv[i])) == 0) { + found = 1; + execute(i, all_tests + j); + break; + } + } + + if (found == 0) + errx(-1, "No such test '%s'", argv[i]); + } + + return (0); +} + +int +execute(int id, struct test *t) { + int result; + + pid_t pid = fork(); + if (pid < 0) + err(-1, "fork"); + if (pid) { + /* Parent: wait for result from child. */ + int status; + while (waitpid(pid, &status, 0) != pid) {} + if (WIFEXITED(status)) + result = WEXITSTATUS(status); + else + result = FAILED; + } else { + /* Child process: run the test. */ + exit(t->t_run()); + } + + printf("%s %d - %s\n", + (result == PASSED) ? "ok" : "not ok", + id, t->t_name); + + return (result); } Modified: head/tools/regression/security/cap_test/cap_test.h ============================================================================== --- head/tools/regression/security/cap_test/cap_test.h Thu Aug 4 14:18:09 2011 (r224650) +++ head/tools/regression/security/cap_test/cap_test.h Thu Aug 4 14:20:13 2011 (r224651) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008-2011 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,10 +30,126 @@ #ifndef CAP_TEST_H #define CAP_TEST_H -void test_capmode(void); -void test_capabilities(void); -void test_syscalls(void); -void test_sysctl(void); -void test_fcntl(void); +#include + +/* + * Define a file required by a test. The test can't complete without the file, + * so if we don't have it, just die. + */ +#define REQUIRE(fd) do { \ + if ((fd) < 0) \ + err(-1, "%s:%d: Missing required file '%s'", \ + __FILE__, __LINE__, #fd); \ +} while (0) + +/* Whether a test passed or failed. */ +#define PASSED 0 +#define FAILED 1 + +/* A test has failed; print a message and clear the 'success' flag. */ +#define FAIL(...) do { \ + warn(__VA_ARGS__); \ + success = FAILED; \ +} while (0) + +/* As above, but do not print the errno message. */ +#define FAILX(...) do { \ + warnx(__VA_ARGS__); \ + success = FAILED; \ +} while (0) + +/* Like an assertion, but don't kill the test, just fail and keep going. */ +#define CHECK(condition) do { \ + if (!(condition)) \ + FAILX("%s:%d: Assertion '%s' failed", \ + __func__, __LINE__, #condition); \ +} while (0) + +/* Make sure that a system call's return value is >= 0. */ +#define CHECK_SYSCALL_SUCCEEDS(syscall, ...) do { \ + if (syscall(__VA_ARGS__) < 0) \ + FAIL("%s() at line %d: %s failed", \ + __func__, __LINE__, #syscall); \ +} while (0) + +/* Make sure that a system call fails with the correct errno. */ +#define CHECK_SYSCALL_FAILS(expected_errno, syscall, ...) do { \ + if (syscall(__VA_ARGS__) < 0) { \ + if (errno != expected_errno) \ + FAIL("%s() at line %d: %s", \ + __func__, __LINE__, #syscall); \ + } else { \ + FAILX("%s() at line %d: %s succeeded; it should've failed", \ + __func__, __LINE__, #syscall); \ + } \ +} while (0) + +/* Make sure that a system call fails, but not with a particular errno. */ +#define CHECK_SYSCALL_FAILS_BUT_NOT_WITH(bad_errno, syscall, ...) do { \ + if (syscall(__VA_ARGS__) < 0) { \ + if (errno == bad_errno) \ + FAIL("%s() at line %d: %s", \ + __func__, __LINE__, #syscall); \ + } else { \ + FAILX("%s() at line %d: %s succeeded; it should've failed", \ + __func__, __LINE__, #syscall); \ + } \ +} while (0) + +/* A system call should fail with ECAPMODE. */ +#define CHECK_CAPMODE(...) \ + CHECK_SYSCALL_FAILS(ECAPMODE, __VA_ARGS__) + +/* A system call should fail, but not with ECAPMODE. */ +#define CHECK_NOT_CAPMODE(...) \ + CHECK_SYSCALL_FAILS_BUT_NOT_WITH(ECAPMODE, __VA_ARGS__) + +/* A system call should fail with ENOTCAPABLE. */ +#define CHECK_NOTCAPABLE(...) \ + CHECK_SYSCALL_FAILS(ENOTCAPABLE, __VA_ARGS__) + +/* Ensure that 'rights' are a subset of 'max'. */ +#define CHECK_RIGHTS(rights, max) do { \ + if ((success == PASSED) && (rights != max)) \ + FAILX("Rights of opened file (%jx) > maximum (%jx)", \ + (cap_rights_t) rights, (cap_rights_t) max); \ +} while (0) + +/* Create a capability from a file descriptor, make sure it succeeds. */ +#define MAKE_CAPABILITY(to, from, rights) do { \ + cap_rights_t _rights; \ + REQUIRE(to = cap_new(from, rights)); \ + CHECK_SYSCALL_SUCCEEDS(cap_getrights, to, &_rights); \ + if ((success == PASSED) && (_rights != (rights))) \ + FAILX("New capability's rights (%jx) != %jx", \ + _rights, (cap_rights_t) (rights)); \ +} while (0) + +/* + * A top-level test should take no arguments and return an integer value, + * either PASSED or FAILED. + * + * Errors such as SIGSEGV will be caught and interpreted as FAILED. + */ +typedef int (*test_function)(void); + +/* Information about a test. */ +struct test { + char *t_name; + test_function t_run; + int t_result; +}; + +/* + * Run a test in a child process so that cap_enter(2) doesn't mess up + * subsequent tests. + */ +int execute(int id, struct test*); + +int test_capmode(void); +int test_capabilities(void); +int test_syscalls(void); +int test_sysctl(void); +int test_fcntl(void); #endif /* CAP_TEST_H */ Modified: head/tools/regression/security/cap_test/cap_test_capmode.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_capmode.c Thu Aug 4 14:18:09 2011 (r224650) +++ head/tools/regression/security/cap_test/cap_test_capmode.c Thu Aug 4 14:20:13 2011 (r224651) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008-2009 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,163 +38,121 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include -#include #include #include #include #include -#include #include -#include #include #include #include #include -/* Need to check machine-dependent sysarch(). */ -#define ARCH_IS(s) (!strncmp(s, MACHINE, sizeof(s) + 1)) - #include "cap_test.h" -void +#define CHECK_SYSCALL_VOID_NOT_ECAPMODE(syscall, ...) do { \ + errno = 0; \ + (void)syscall(__VA_ARGS__); \ + if (errno == ECAPMODE) \ + FAIL("capmode: %s failed with ECAPMODE", #syscall); \ +} while (0) + +int test_capmode(void) { - struct sockaddr_in sin; struct statfs statfs; struct stat sb; - ssize_t len; long sysarch_arg = 0; - int fd, fd_close, fd_dir, fd_file, fd_socket, fd2[2], ret; + int fd_close, fd_dir, fd_file, fd_socket, fd2[2]; + int success = PASSED; pid_t pid, wpid; char ch; - fd_file = open("/tmp/cap_test_syscalls", O_RDWR|O_CREAT, 0644); - if (fd_file < 0) - err(-1, "test_syscalls:prep: open cap_test_syscalls"); - - fd_close = open("/dev/null", O_RDWR); - if (fd_close < 0) - err(-1, "test_syscalls:prep: open /dev/null"); - - fd_dir = open("/tmp", O_RDONLY); - if (fd_dir < 0) - err(-1, "test_syscalls:prep: open /tmp"); - - fd_socket = socket(PF_INET, SOCK_DGRAM, 0); - if (fd_socket < 0) - err(-1, "test_syscalls:prep: socket"); - - if (cap_enter() < 0) - err(-1, "test_syscalls:prep: cap_enter"); - - - bzero(&sin, sizeof(sin)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; + /* Open some files to play with. */ + REQUIRE(fd_file = open("/tmp/cap_capmode", O_RDWR|O_CREAT, 0644)); + REQUIRE(fd_close = open("/dev/null", O_RDWR)); + REQUIRE(fd_dir = open("/tmp", O_RDONLY)); + REQUIRE(fd_socket = socket(PF_INET, SOCK_DGRAM, 0)); + + /* Enter capability mode. */ + REQUIRE(cap_enter()); + + /* + * System calls that are not permitted in capability mode. + */ + CHECK_CAPMODE(access, "/tmp/cap_capmode_access", F_OK); + CHECK_CAPMODE(acct, "/tmp/cap_capmode_acct"); + CHECK_CAPMODE(bind, PF_INET, NULL, 0); + CHECK_CAPMODE(chdir, "/tmp/cap_capmode_chdir"); + CHECK_CAPMODE(chflags, "/tmp/cap_capmode_chflags", UF_NODUMP); + CHECK_CAPMODE(chmod, "/tmp/cap_capmode_chmod", 0644); + CHECK_CAPMODE(chown, "/tmp/cap_capmode_chown", -1, -1); + CHECK_CAPMODE(chroot, "/tmp/cap_capmode_chroot"); + CHECK_CAPMODE(connect, PF_INET, NULL, 0); + CHECK_CAPMODE(creat, "/tmp/cap_capmode_creat", 0644); + CHECK_CAPMODE(fchdir, fd_dir); + CHECK_CAPMODE(getfsstat, &statfs, sizeof(statfs), MNT_NOWAIT); + CHECK_CAPMODE(link, "/tmp/foo", "/tmp/bar"); + CHECK_CAPMODE(lstat, "/tmp/cap_capmode_lstat", &sb); + CHECK_CAPMODE(mknod, "/tmp/capmode_mknod", 06440, 0); + CHECK_CAPMODE(mount, "procfs", "/not_mounted", 0, NULL); + CHECK_CAPMODE(open, "/dev/null", O_RDWR); + CHECK_CAPMODE(readlink, "/tmp/cap_capmode_readlink", NULL, 0); + CHECK_CAPMODE(revoke, "/tmp/cap_capmode_revoke"); + CHECK_CAPMODE(stat, "/tmp/cap_capmode_stat", &sb); + CHECK_CAPMODE(symlink, + "/tmp/cap_capmode_symlink_from", + "/tmp/cap_capmode_symlink_to"); + CHECK_CAPMODE(unlink, "/tmp/cap_capmode_unlink"); + CHECK_CAPMODE(unmount, "/not_mounted", 0); + + /* + * System calls that are permitted in capability mode. + */ + CHECK_SYSCALL_SUCCEEDS(close, fd_close); + CHECK_SYSCALL_SUCCEEDS(dup, fd_file); + CHECK_SYSCALL_SUCCEEDS(fstat, fd_file, &sb); + CHECK_SYSCALL_SUCCEEDS(lseek, fd_file, SEEK_SET, 0); + CHECK_SYSCALL_SUCCEEDS(msync, &fd_file, 8192, MS_ASYNC); + CHECK_SYSCALL_SUCCEEDS(profil, NULL, 0, 0, 0); + CHECK_SYSCALL_SUCCEEDS(read, fd_file, &ch, sizeof(ch)); + CHECK_SYSCALL_SUCCEEDS(recvfrom, fd_socket, NULL, 0, 0, NULL, NULL); + CHECK_SYSCALL_SUCCEEDS(setuid, getuid()); + CHECK_SYSCALL_SUCCEEDS(write, fd_file, &ch, sizeof(ch)); + + /* + * These calls will fail for lack of e.g. a proper name to send to, + * but they are allowed in capability mode, so errno != ECAPMODE. + */ + CHECK_NOT_CAPMODE(accept, fd_socket, NULL, NULL); + CHECK_NOT_CAPMODE(getpeername, fd_socket, NULL, NULL); + CHECK_NOT_CAPMODE(getsockname, fd_socket, NULL, NULL); + CHECK_NOT_CAPMODE(fchflags, fd_file, UF_NODUMP); + CHECK_NOT_CAPMODE(recvmsg, fd_socket, NULL, 0); + CHECK_NOT_CAPMODE(sendmsg, fd_socket, NULL, 0); + CHECK_NOT_CAPMODE(sendto, fd_socket, NULL, 0, 0, NULL, 0); + + /* + * System calls which should be allowed in capability mode, but which + * don't return errors, and are thus difficult to check. + * + * We will try anyway, by checking errno. + */ + CHECK_SYSCALL_VOID_NOT_ECAPMODE(getegid); + CHECK_SYSCALL_VOID_NOT_ECAPMODE(geteuid); + CHECK_SYSCALL_VOID_NOT_ECAPMODE(getgid); + CHECK_SYSCALL_VOID_NOT_ECAPMODE(getpid); + CHECK_SYSCALL_VOID_NOT_ECAPMODE(getppid); + CHECK_SYSCALL_VOID_NOT_ECAPMODE(getuid); /* - * Here begin the tests, sorted roughly alphabetically by system call - * name. + * Finally, tests for system calls that don't fit the pattern very well. */ - fd = accept(fd_socket, NULL, NULL); - if (fd < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:accept"); - } else { - warnx("test_syscalls:accept succeeded"); - close(fd); - } - - if (access("/tmp/cap_test_syscalls_access", F_OK) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:access"); - } else - warnx("test_syscalls:access succeeded"); - - if (acct("/tmp/cap_test_syscalls_acct") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:acct"); - } else - warnx("test_syscalls:acct succeeded"); - - if (bind(PF_INET, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - if (errno != ECAPMODE) - warn("test_syscall:bind"); - } else - warnx("test_syscall:bind succeeded"); - - if (chdir("/tmp/cap_test_syscalls_chdir") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:chdir"); - } else - warnx("test_syscalls:chdir succeeded"); - - if (chflags("/tmp/cap_test_syscalls_chflags", UF_NODUMP) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:chflags"); - } else - warnx("test_syscalls:chflags succeeded"); - - if (chmod("/tmp/cap_test_syscalls_chmod", 0644) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:chmod"); - } else - warnx("test_syscalls:chmod succeeded"); - - if (chown("/tmp/cap_test_syscalls_chown", -1, -1) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:chown"); - } else - warnx("test_syscalls:chown succeeded"); - - if (chroot("/tmp/cap_test_syscalls_chroot") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:chroot"); - } else - warnx("test_syscalls:chroot succeeded"); - - if (close(fd_close)) { - if (errno == ECAPMODE) - warnx("test_syscalls:close"); - else - warn("test_syscalls:close"); - } - - if (connect(PF_INET, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - if (errno != ECAPMODE) - warn("test_syscall:connect"); - } else - warnx("test_syscall:connect succeeded"); - - fd = creat("/tmp/cap_test_syscalls_creat", 0644); - if (fd >= 0) { - warnx("test_syscalls:creat succeeded"); - close(fd); - } else if (errno != ECAPMODE) - warn("test_syscalls:creat"); - - fd = dup(fd_file); - if (fd < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:dup"); - } else - close(fd); - - if (fchdir(fd_dir) < 0) { - if (errno != ECAPMODE) - warn("test_syscall:fchdir"); - } else - warnx("test_syscalls:fchdir succeeded"); - - if (fchflags(fd_file, UF_NODUMP) < 0) { - if (errno == ECAPMODE) - warnx("test_syscall:fchflags"); - } - pid = fork(); if (pid >= 0) { if (pid == 0) { @@ -202,225 +161,40 @@ test_capmode(void) wpid = waitpid(pid, NULL, 0); if (wpid < 0) { if (errno != ECAPMODE) - warn("test_syscalls:waitpid"); + FAIL("capmode:waitpid"); } else - warnx("test_syscalls:waitpid succeeded"); + FAIL("capmode:waitpid succeeded"); } } else - warn("test_syscalls:fork"); - - if (fstat(fd_file, &sb) < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:fstat"); - } - - /* - * getegid() can't return an error but check for it anyway. - */ - errno = 0; - (void)getegid(); - if (errno == ECAPMODE) - warnx("test_syscalls:getegid"); - - /* - * geteuid() can't return an error but check for it anyway. - */ - errno = 0; - geteuid(); - if (errno == ECAPMODE) - warnx("test_syscalls:geteuid"); - - if (getfsstat(&statfs, sizeof(statfs), MNT_NOWAIT) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:getfsstat"); - } else - warnx("test_syscalls:getfsstat succeeded"); - - /* - * getgid() can't return an error but check for it anyway. - */ - errno = 0; - getgid(); - if (errno == ECAPMODE) - warnx("test_syscalls:getgid"); - - if (getpeername(fd_socket, NULL, NULL) < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:getpeername"); - } + FAIL("capmode:fork"); if (getlogin() == NULL) - warn("test_sycalls:getlogin %d", errno); - - /* - * getpid() can't return an error but check for it anyway. - */ - errno = 0; - (void)getpid(); - if (errno == ECAPMODE) - warnx("test_syscalls:getpid"); - - /* - * getppid() can't return an error but check for it anyway. - */ - errno = 0; - (void)getppid(); - if (errno == ECAPMODE) - warnx("test_syscalls:getppid"); + FAIL("test_sycalls:getlogin %d", errno); if (getsockname(fd_socket, NULL, NULL) < 0) { if (errno == ECAPMODE) - warnx("test_syscalls:getsockname"); + FAIL("capmode:getsockname"); } - /* - * getuid() can't return an error but check for it anyway. - */ - errno = 0; - (void)getuid(); - if (errno == ECAPMODE) - warnx("test_syscalls:getuid"); - /* XXXRW: ktrace */ - if (link("/tmp/foo", "/tmp/bar") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:link"); - } else - warnx("test_syscalls:link succeeded"); - - ret = lseek(fd_file, SEEK_SET, 0); - if (ret < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:lseek"); - else - warn("test_syscalls:lseek"); - } - - if (lstat("/tmp/cap_test_syscalls_lstat", &sb) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:lstat"); - } else - warnx("test_syscalls:lstat succeeded"); - - if (mknod("/tmp/test_syscalls_mknod", 06440, 0) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:mknod"); - } else - warnx("test_syscalls:mknod succeeded"); - - /* - * mount() is a bit tricky but do our best. - */ - if (mount("procfs", "/not_mounted", 0, NULL) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:mount"); - } else - warnx("test_syscalls:mount succeeded"); - - if (msync(&fd_file, 8192, MS_ASYNC) < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:msync"); - } - - fd = open("/dev/null", O_RDWR); - if (fd >= 0) { - warnx("test_syscalls:open succeeded"); - close(fd); - } - if (pipe(fd2) == 0) { close(fd2[0]); close(fd2[1]); } else if (errno == ECAPMODE) - warnx("test_syscalls:pipe"); - - if (profil(NULL, 0, 0, 0) < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:profile"); - } + FAIL("capmode:pipe"); /* XXXRW: ptrace. */ - len = read(fd_file, &ch, sizeof(ch)); - if (len < 0 && errno == ECAPMODE) - warnx("test_syscalls:read"); - - if (readlink("/tmp/cap_test_syscalls_readlink", NULL, 0) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:readlink"); - } else - warnx("test_syscalls:readlink succeeded"); - - len = recvfrom(fd_socket, NULL, 0, 0, NULL, NULL); - if (len < 0 && errno == ECAPMODE) - warnx("test_syscalls:recvfrom"); - - len = recvmsg(fd_socket, NULL, 0); - if (len < 0 && errno == ECAPMODE) - warnx("test_syscalls:recvmsg"); - - if (revoke("/tmp/cap_test_syscalls_revoke") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:revoke"); - } else - warnx("test_syscalls:revoke succeeded"); - - len = sendmsg(fd_socket, NULL, 0); - if (len < 0 && errno == ECAPMODE) - warnx("test_syscalls:sendmsg"); - - len = sendto(fd_socket, NULL, 0, 0, NULL, 0); - if (len < 0 && errno == ECAPMODE) - warn("test_syscalls:sendto(NULL)"); - - if (setuid(getuid()) < 0) { - if (errno == ECAPMODE) - warnx("test_syscalls:setuid"); - } - - if (stat("/tmp/cap_test_syscalls_stat", &sb) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:stat"); - } else - warnx("test_syscalls:stat succeeded"); - - if (symlink("/tmp/cap_test_syscalls_symlink_from", - "/tmp/cap_test_syscalls_symlink_to") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:symlink"); - } else - warnx("test_syscalls:symlink succeeded"); - /* sysarch() is, by definition, architecture-dependent */ - if (ARCH_IS("i386") || ARCH_IS("amd64")) { - if (sysarch(I386_SET_IOPERM, &sysarch_arg) != -1) - warnx("test_syscalls:sysarch succeeded"); - else if (errno != ECAPMODE) - warn("test_syscalls:sysarch errno != ECAPMODE"); - - /* XXXJA: write a test for arm */ - } else { - warnx("test_syscalls:no sysarch() test for architecture '%s'", MACHINE); - } +#if defined (__amd64__) || defined (__i386__) + CHECK_CAPMODE(sysarch, I386_SET_IOPERM, &sysarch_arg); +#else + /* XXXJA: write a test for arm */ + FAIL("capmode:no sysarch() test for current architecture"); +#endif /* XXXRW: No error return from sync(2) to test. */ - if (unlink("/tmp/cap_test_syscalls_unlink") < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:unlink"); - } else - warnx("test_syscalls:unlink succeeded"); - - if (unmount("/not_mounted", 0) < 0) { - if (errno != ECAPMODE) - warn("test_syscalls:unmount"); - } else - warnx("test_syscalls:unmount succeeded"); - - len = write(fd_file, &ch, sizeof(ch)); - if (len < 0 && errno == ECAPMODE) - warnx("test_syscalls:write"); - - exit(0); + return (success); } Modified: head/tools/regression/security/cap_test/cap_test_sysctl.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_sysctl.c Thu Aug 4 14:18:09 2011 (r224650) +++ head/tools/regression/security/cap_test/cap_test_sysctl.c Thu Aug 4 14:20:13 2011 (r224651) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008-2011 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,11 +36,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include -#include #include #include #include @@ -50,18 +51,17 @@ __FBSDID("$FreeBSD$"); * Certain sysctls are permitted in capability mode, but most are not. Test * for the ones that should be, and try one or two that shouldn't. */ -void +int test_sysctl(void) { - int error, i, oid[2]; + int i, oid[2]; + int success = PASSED; size_t len; oid[0] = CTL_KERN; oid[1] = KERN_OSRELDATE; len = sizeof(i); - error = sysctl(oid, 2, &i, &len, NULL, 0); - if (error) - warnx("capmode and kern.osreldate failed error %d", errno); + CHECK(sysctl(oid, 2, &i, &len, NULL, 0) == 0); - exit(0); + return (success); } From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 14:38:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2AB1106564A; Thu, 4 Aug 2011 14:38:30 +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 D34BF8FC08; Thu, 4 Aug 2011 14:38:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p74EcUkG065264; Thu, 4 Aug 2011 14:38:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p74EcUNg065262; Thu, 4 Aug 2011 14:38:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108041438.p74EcUNg065262@svn.freebsd.org> From: Marius Strobl Date: Thu, 4 Aug 2011 14:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224652 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 14:38:31 -0000 Author: marius Date: Thu Aug 4 14:38:30 2011 New Revision: 224652 URL: http://svn.freebsd.org/changeset/base/224652 Log: The release/pc98/mkisoimages.sh added as part of r221466 now also takes "-b" to indicate the creation of a bootable image. Approved by: re (kib) Modified: head/release/Makefile.sysinstall Modified: head/release/Makefile.sysinstall ============================================================================== --- head/release/Makefile.sysinstall Thu Aug 4 14:20:13 2011 (r224651) +++ head/release/Makefile.sysinstall Thu Aug 4 14:38:30 2011 (r224652) @@ -349,12 +349,8 @@ EXTRAS+= cdrom.1 cdrom.2 cdrom.3 .if defined(MAKE_ISOS) EXTRAS+= iso.1 .endif -.if ${TARGET} == "pc98" -BOOTABLE="-G" -.else BOOTABLE="-b" .endif -.endif .if !defined(NODOC) DOCREL= doc.1 doc.2 From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 17:17:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50BEE1065677; Thu, 4 Aug 2011 17:17:58 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1478FC1E; Thu, 4 Aug 2011 17:17:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p74HHwcg069983; Thu, 4 Aug 2011 17:17:58 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p74HHwF6069980; Thu, 4 Aug 2011 17:17:58 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108041717.p74HHwF6069980@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 4 Aug 2011 17:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224653 - head/tools/regression/security/cap_test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 17:17:58 -0000 Author: jonathan Date: Thu Aug 4 17:17:57 2011 New Revision: 224653 URL: http://svn.freebsd.org/changeset/base/224653 Log: Flesh out the cap_test regression test. Add more regression testing, some of which is expected to fail until we commit more kernel implementation. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Added: head/tools/regression/security/cap_test/cap_test.t (contents, props changed) head/tools/regression/security/cap_test/cap_test_capabilities.c (contents, props changed) head/tools/regression/security/cap_test/cap_test_fcntl.c (contents, props changed) Added: head/tools/regression/security/cap_test/cap_test.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/security/cap_test/cap_test.t Thu Aug 4 17:17:57 2011 (r224653) @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +if test -z "${DIR}" ; then DIR=$( make -V .OBJDIR ); fi +if test -z "${DIR}" ; then DIR=$( dirname $0 ); fi + +make > /dev/null || exit 1 +$DIR/cap_test $* + Added: head/tools/regression/security/cap_test/cap_test_capabilities.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/security/cap_test/cap_test_capabilities.c Thu Aug 4 17:17:57 2011 (r224653) @@ -0,0 +1,260 @@ +/*- + * Copyright (c) 2009-2011 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson + * 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. + */ + +/* + * Test whether various operations on capabilities are properly masked for + * various object types. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "cap_test.h" + +#define SYSCALL_FAIL(syscall, message) \ + FAIL("%s:\t%s (rights 0x%jx)", #syscall, message, rights) + +/* + * Ensure that, if the capability had enough rights for the system call to + * pass, then it did. Otherwise, ensure that the errno is ENOTCAPABLE; + * capability restrictions should kick in before any other error logic. + */ +#define CHECK_RESULT(syscall, rights_needed, succeeded) do { \ + if ((rights & (rights_needed)) == (rights_needed)) { \ + if (!(succeeded)) \ + SYSCALL_FAIL(syscall, "failed"); \ + } else { \ + if (succeeded) \ + FAILX("%s:\tsucceeded when it shouldn't have" \ + " (rights 0x%jx)", #syscall, rights); \ + else if (errno != ENOTCAPABLE) \ + SYSCALL_FAIL(syscall, "errno != ENOTCAPABLE"); \ + } \ +} while (0) + +/* + * As above, but for the special mmap() case: unmap after successful mmap(). + */ +#define CHECK_MMAP_RESULT(rights_needed) do { \ + if ((rights & (rights_needed)) == (rights_needed)) { \ + if (p == MAP_FAILED) \ + SYSCALL_FAIL(mmap, "failed"); \ + else \ + (void)munmap(p, getpagesize()); \ + } else { \ + if (p != MAP_FAILED) { \ + FAILX("%s:\tsucceeded when it shouldn't have" \ + " (rights 0x%jx)", "mmap", rights); \ + (void)munmap(p, getpagesize()); \ + } else if (errno != ENOTCAPABLE) \ + SYSCALL_FAIL(syscall, "errno != ENOTCAPABLE"); \ + } \ +} while (0) + +/* + * Given a file descriptor, create a capability with specific rights and + * make sure only those rights work. +*/ +static int +try_file_ops(int fd, cap_rights_t rights) +{ + struct stat sb; + struct statfs sf; + int fd_cap, fd_capcap; + ssize_t ssize, ssize2; + off_t off; + void *p; + char ch; + int ret; + int success = PASSED; + + REQUIRE(fd_cap = cap_new(fd, rights)); + REQUIRE(fd_capcap = cap_new(fd_cap, rights)); + CHECK(fd_capcap != fd_cap); + + ssize = read(fd_cap, &ch, sizeof(ch)); + CHECK_RESULT(read, CAP_READ | CAP_SEEK, ssize >= 0); + + ssize = pread(fd_cap, &ch, sizeof(ch), 0); + ssize2 = pread(fd_cap, &ch, sizeof(ch), 0); + CHECK_RESULT(pread, CAP_READ, ssize >= 0); + CHECK(ssize == ssize2); + + ssize = write(fd_cap, &ch, sizeof(ch)); + CHECK_RESULT(write, CAP_WRITE | CAP_SEEK, ssize >= 0); + + ssize = pwrite(fd_cap, &ch, sizeof(ch), 0); + CHECK_RESULT(pwrite, CAP_WRITE, ssize >= 0); + + off = lseek(fd_cap, 0, SEEK_SET); + CHECK_RESULT(lseek, CAP_SEEK, off >= 0); + + ret = fchflags(fd_cap, UF_NODUMP); + CHECK_RESULT(fchflags, CAP_FCHFLAGS, ret == 0); + + ret = fstat(fd_cap, &sb); + CHECK_RESULT(fstat, CAP_FSTAT, ret == 0); + + p = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED, fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ); + + p = mmap(NULL, getpagesize(), PROT_WRITE, MAP_SHARED, fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_WRITE); + + p = mmap(NULL, getpagesize(), PROT_EXEC, MAP_SHARED, fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_MAPEXEC); + + p = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, + fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ | CAP_WRITE); + + p = mmap(NULL, getpagesize(), PROT_READ | PROT_EXEC, MAP_SHARED, + fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ | CAP_MAPEXEC); + + p = mmap(NULL, getpagesize(), PROT_EXEC | PROT_WRITE, MAP_SHARED, + fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_MAPEXEC | CAP_WRITE); + + p = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_SHARED, fd_cap, 0); + CHECK_MMAP_RESULT(CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC); + + ret = fsync(fd_cap); + CHECK_RESULT(fsync, CAP_FSYNC, ret == 0); + + ret = fchown(fd_cap, -1, -1); + CHECK_RESULT(fchown, CAP_FCHOWN, ret == 0); + + ret = fchmod(fd_cap, 0644); + CHECK_RESULT(fchmod, CAP_FCHMOD, ret == 0); + + /* XXX flock */ + + ret = ftruncate(fd_cap, 0); + CHECK_RESULT(ftruncate, CAP_FTRUNCATE, ret == 0); + + ret = fstatfs(fd_cap, &sf); + CHECK_RESULT(fstatfs, CAP_FSTATFS, ret == 0); + + ret = fpathconf(fd_cap, _PC_NAME_MAX); + CHECK_RESULT(fpathconf, CAP_FPATHCONF, ret >= 0); + + ret = futimes(fd_cap, NULL); + CHECK_RESULT(futimes, CAP_FUTIMES, ret == 0); + + /* XXX select / poll / kqueue */ + + close (fd_cap); + return (success); +} + +#define TRY(fd, rights) \ +do { \ + if (success == PASSED) \ + success = try_file_ops(fd, rights); \ + else \ + /* We've already failed, but try the test anyway. */ \ + try_file_ops(fd, rights); \ +} while (0) + +int +test_capabilities(void) +{ + int fd; + int success = PASSED; + + fd = open("/tmp/cap_test", O_RDWR | O_CREAT, 0644); + if (fd < 0) + err(-1, "open"); + + if (cap_enter() < 0) + err(-1, "cap_enter"); + + /* XXX: Really want to try all combinations. */ + TRY(fd, CAP_READ); + TRY(fd, CAP_READ | CAP_SEEK); + TRY(fd, CAP_WRITE); + TRY(fd, CAP_WRITE | CAP_SEEK); + TRY(fd, CAP_READ | CAP_WRITE); + TRY(fd, CAP_READ | CAP_WRITE | CAP_SEEK); + TRY(fd, CAP_SEEK); + TRY(fd, CAP_FCHFLAGS); + TRY(fd, CAP_IOCTL); + TRY(fd, CAP_FSTAT); + TRY(fd, CAP_MMAP); + TRY(fd, CAP_MMAP | CAP_READ); + TRY(fd, CAP_MMAP | CAP_WRITE); + TRY(fd, CAP_MMAP | CAP_MAPEXEC); + TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE); + TRY(fd, CAP_MMAP | CAP_READ | CAP_MAPEXEC); + TRY(fd, CAP_MMAP | CAP_MAPEXEC | CAP_WRITE); + TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC); + TRY(fd, CAP_FCNTL); + TRY(fd, CAP_EVENT); + TRY(fd, CAP_KEVENT); + TRY(fd, CAP_FSYNC); + TRY(fd, CAP_FCHOWN); + TRY(fd, CAP_FCHMOD); + TRY(fd, CAP_FTRUNCATE); + TRY(fd, CAP_FLOCK); + TRY(fd, CAP_FSTATFS); + TRY(fd, CAP_FPATHCONF); + TRY(fd, CAP_FUTIMES); + TRY(fd, CAP_ACL_GET); + TRY(fd, CAP_ACL_SET); + TRY(fd, CAP_ACL_DELETE); + TRY(fd, CAP_ACL_CHECK); + TRY(fd, CAP_EXTATTR_GET); + TRY(fd, CAP_EXTATTR_SET); + TRY(fd, CAP_EXTATTR_DELETE); + TRY(fd, CAP_EXTATTR_LIST); + TRY(fd, CAP_MAC_GET); + TRY(fd, CAP_MAC_SET); + + /* + * Socket-specific. + */ + TRY(fd, CAP_GETPEERNAME); + TRY(fd, CAP_GETSOCKNAME); + TRY(fd, CAP_ACCEPT); + + return (success); +} Added: head/tools/regression/security/cap_test/cap_test_fcntl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/security/cap_test/cap_test_fcntl.c Thu Aug 4 17:17:57 2011 (r224653) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2009-2011 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson + * 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. + */ + +/* + * Test that fcntl works in capability mode. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "cap_test.h" + +/* A filename->descriptor mapping. */ +struct fd { + char *f_name; + int f_fd; +}; + +/* + * Ensure that fcntl() works consistently for both regular file descriptors and + * capability-wrapped ones. + */ +int +test_fcntl(void) +{ + int success = PASSED; + cap_rights_t rights = CAP_READ | CAP_FCNTL; + + /* + * Open some files of different types, and wrap them in capabilities. + */ + struct fd files[] = { + { "file", open("/etc/passwd", O_RDONLY) }, + { "socket", socket(PF_LOCAL, SOCK_STREAM, 0) }, + { "SHM", shm_open(SHM_ANON, O_RDWR, 0600) }, + }; + REQUIRE(files[0].f_fd); + REQUIRE(files[1].f_fd); + REQUIRE(files[2].f_fd); + + struct fd caps[] = { + { "file cap", cap_new(files[0].f_fd, rights) }, + { "socket cap", cap_new(files[1].f_fd, rights) }, + { "SHM cap", cap_new(files[2].f_fd, rights) }, + }; + REQUIRE(caps[0].f_fd); + REQUIRE(caps[1].f_fd); + REQUIRE(caps[2].f_fd); + + struct fd all[] = { + files[0], caps[0], + files[1], caps[1], + files[2], caps[2], + }; + const size_t len = sizeof(all) / sizeof(struct fd); + + REQUIRE(cap_enter()); + + /* + * Ensure that we can fcntl() all the files that we opened above. + */ + for (size_t i = 0; i < len; i++) + { + struct fd f = all[i]; + int cap; + + CHECK_SYSCALL_SUCCEEDS(fcntl, f.f_fd, F_GETFL, 0); + REQUIRE(cap = cap_new(f.f_fd, CAP_READ)); + if (fcntl(f.f_fd, F_GETFL, 0) == -1) + FAIL("Error calling fcntl('%s', F_GETFL)", f.f_name); + else + CHECK_NOTCAPABLE(fcntl, cap, F_GETFL, 0); + } + + return (success); +} + From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 21:46:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 7BEF3106564A; Thu, 4 Aug 2011 21:46:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Thu, 4 Aug 2011 17:46:40 -0400 User-Agent: KMail/1.6.2 References: <201108021913.p72JDun2064946@svn.freebsd.org> In-Reply-To: <201108021913.p72JDun2064946@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108041746.47551.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Martin Matuska Subject: Re: svn commit: r224614 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 21:46:55 -0000 On Tuesday 02 August 2011 03:13 pm, Martin Matuska wrote: > Author: mm > Date: Tue Aug 2 19:13:56 2011 > New Revision: 224614 > URL: http://svn.freebsd.org/changeset/base/224614 > > Log: > For mount, discover f_mntonname from supplied path argument > using vn_fullpath_global(). This fixes f_mntonname if mounting > inside chroot, jail or with relative path as argument. > > For unmount in jail, use vn_fullpath_global() to discover > global path from supplied path argument. This fixes unmount in > jail. It seems fdescfs(5) hangs after this commit if the mount point is /dev/fd. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 22:49:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D87F31065673; Thu, 4 Aug 2011 22:49:40 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id B7B798FC08; Thu, 4 Aug 2011 22:49:40 +0000 (UTC) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 846A7152D0; Thu, 4 Aug 2011 15:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1312498180; bh=G56q0X3+gs1axL5FzKye8jAf8g0Sq0w4I7MqYVUxeBk=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type; b=4SvfQQMabFWPz7MW6b33700+Y2k4/SOzEgjSZ6mdw1Ajdk1kfg3thtAXVLXQ36kc/ ZULut3rKzFcER3u2WJCYrATBGSoep/yF4ZdZ32HE2bdwN/5bgdoROmr/SHxXwIksL0 d8uv7tN2Sz/BSRcAcMrDsI2DZ34QItjoWzqiTgZ4= Message-ID: <4E3B2202.30205@delphij.net> Date: Thu, 04 Aug 2011 15:49:38 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: Jung-uk Kim References: <201108021913.p72JDun2064946@svn.freebsd.org> <201108041746.47551.jkim@FreeBSD.org> In-Reply-To: <201108041746.47551.jkim@FreeBSD.org> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------020907050005030601080603" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@FreeBSD.org, Martin Matuska Subject: Re: svn commit: r224614 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 22:49:41 -0000 This is a multi-part message in MIME format. --------------020907050005030601080603 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 08/04/11 14:46, Jung-uk Kim wrote: > On Tuesday 02 August 2011 03:13 pm, Martin Matuska wrote: >> Author: mm Date: Tue Aug 2 19:13:56 2011 New Revision: 224614 URL: >> http://svn.freebsd.org/changeset/base/224614 >> >> Log: For mount, discover f_mntonname from supplied path argument >> using vn_fullpath_global(). This fixes f_mntonname if mounting >> inside chroot, jail or with relative path as argument. >> >> For unmount in jail, use vn_fullpath_global() to discover global >> path from supplied path argument. This fixes unmount in jail. > > It seems fdescfs(5) hangs after this commit if the mount point is > /dev/fd. Please find attached kib@'s patch that fixes this issue (david wolfskill and I have both tested individually). Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOOyIBAAoJEATO+BI/yjfB7TAIAMHOQVpyZf8ZwayvMQ0Dnl5L N9c+ttuSDTlrIApj20Hz8Ezp1Z+u91euwhGizXq61F5KBmD2J1CmjNXIsanLlRn5 DXebrls7KRLwqRAPf6HciIaU8G0d9ktP1Z3cHDRgLbc43cEEJHHi5WuMREtENTF2 RUkQwh8m7PTlzFnyIGVnamTkpF9AC2xK4XSlrdVSn+tEWFMVXPWo8EIvh1vJRwZ3 CKCF/aLyVC/DD2LAi9IWHIx4MQ4x9LoQFzBiOzkhhv63JmL0hd8E6GNei6VQS/yK rQ+Td8YEwOVttpXF62CiNarYzKmOoMhJ3oaKt922V6uoxIXh3/Dh4xSXt/ZDxV0= =q2uo -----END PGP SIGNATURE----- --------------020907050005030601080603 Content-Type: text/plain; name="kib-vfs_mount.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kib-vfs_mount.c.diff" Index: sys/kern/vfs_mount.c =================================================================== --- sys/kern/vfs_mount.c (revision 224652) +++ sys/kern/vfs_mount.c (working copy) @@ -746,13 +746,15 @@ vfs_domount_first( struct thread *td, /* Calling thread. */ struct vfsconf *vfsp, /* File system type. */ struct vnode *vp, /* Vnode to be covered. */ + char *ufspath, int fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ ) { struct vattr va; + struct nameidata nd; struct mount *mp; - struct vnode *newdp; + struct vnode *newdp, *vp1; char *fspath, *fbuf; int error; @@ -761,18 +763,47 @@ vfs_domount_first( KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); /* Construct global filesystem path from vp. */ + VOP_UNLOCK(vp, 0); error = vn_fullpath_global(td, vp, &fspath, &fbuf); if (error != 0) { - vput(vp); + vrele(vp); return (error); } if (strlen(fspath) >= MNAMELEN) { - vput(vp); + vrele(vp); free(fbuf, M_TEMP); return (ENAMETOOLONG); } + if ((vp->v_iflag & VI_DOOMED) != 0) { + vrele(vp); + free(fbuf, M_TEMP); + return (EBADF); + } /* + * Re-lookup the vnode by path. As a side effect, the vnode is + * relocked. If vnode was renamed, return ENOENT. + */ + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + UIO_SYSSPACE, ufspath, td); + error = namei(&nd); + if (error != 0) { + vrele(vp); + free(fbuf, M_TEMP); + return (error); + } + if (NDHASGIANT(&nd)) + mtx_unlock(&Giant); + NDFREE(&nd, NDF_ONLY_PNBUF); + vp1 = nd.ni_vp; + vrele(vp); + if (vp1 != vp) { + vput(vp1); + free(fbuf, M_TEMP); + return (ENOENT); + } + + /* * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. */ @@ -1084,14 +1115,11 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) - error = vfs_domount_first(td, vfsp, vp, fsflags, optlist); + error = vfs_domount_first(td, vfsp, vp, fspath, fsflags, optlist); else error = vfs_domount_update(td, vp, fsflags, optlist); mtx_unlock(&Giant); - ASSERT_VI_UNLOCKED(vp, __func__); - ASSERT_VOP_UNLOCKED(vp, __func__); - return (error); } --------------020907050005030601080603-- From owner-svn-src-head@FreeBSD.ORG Thu Aug 4 23:36:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 327C2106566B; Thu, 4 Aug 2011 23:36:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: d@delphij.net Date: Thu, 4 Aug 2011 19:36:09 -0400 User-Agent: KMail/1.6.2 References: <201108021913.p72JDun2064946@svn.freebsd.org> <201108041746.47551.jkim@FreeBSD.org> <4E3B2202.30205@delphij.net> In-Reply-To: <4E3B2202.30205@delphij.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108041936.12732.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Martin Matuska Subject: Re: svn commit: r224614 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2011 23:36:20 -0000 On Thursday 04 August 2011 06:49 pm, Xin LI wrote: > On 08/04/11 14:46, Jung-uk Kim wrote: > > On Tuesday 02 August 2011 03:13 pm, Martin Matuska wrote: > >> Author: mm Date: Tue Aug 2 19:13:56 2011 New Revision: 224614 > >> URL: http://svn.freebsd.org/changeset/base/224614 > >> > >> Log: For mount, discover f_mntonname from supplied path argument > >> using vn_fullpath_global(). This fixes f_mntonname if mounting > >> inside chroot, jail or with relative path as argument. > >> > >> For unmount in jail, use vn_fullpath_global() to discover global > >> path from supplied path argument. This fixes unmount in jail. > > > > It seems fdescfs(5) hangs after this commit if the mount point is > > /dev/fd. > > Please find attached kib@'s patch that fixes this issue (david > wolfskill and I have both tested individually). Yes, it cured the hang. Thanks, Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 11:12:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B65B1106564A; Fri, 5 Aug 2011 11:12:50 +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 A65EF8FC12; Fri, 5 Aug 2011 11:12:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75BCoGh003864; Fri, 5 Aug 2011 11:12:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75BCoDr003862; Fri, 5 Aug 2011 11:12:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108051112.p75BCoDr003862@svn.freebsd.org> From: Martin Matuska Date: Fri, 5 Aug 2011 11:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224655 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 11:12:50 -0000 Author: mm Date: Fri Aug 5 11:12:50 2011 New Revision: 224655 URL: http://svn.freebsd.org/changeset/base/224655 Log: The change in r224615 didn't take into account that vn_fullpath_global() doesn't operate on locked vnode. This could cause a panic. Fix by unlocking vnode, re-locking afterwards and verifying that it wasn't renamed or deleted. To improve readability and reduce code size, move code to a new static function vfs_verify_global_path(). In addition, fix missing giant unlock in unmount(). Reported by: David Wolfskill Reviewed by: kib Approved by: re (bz) MFC after: 2 weeks Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Aug 5 06:57:44 2011 (r224654) +++ head/sys/kern/vfs_mount.c Fri Aug 5 11:12:50 2011 (r224655) @@ -362,6 +362,60 @@ vfs_mergeopts(struct vfsoptlist *toopts, } /* + * Verify vnode's global path + */ +static int +vfs_verify_global_path(struct thread *td, struct vnode *vp, char *fspath) +{ + struct nameidata nd; + struct vnode *vp1; + char *rpath, *fbuf; + int error; + + ASSERT_VOP_ELOCKED(vp, __func__); + + /* Construct global filesystem path from vp. */ + VOP_UNLOCK(vp, 0); + error = vn_fullpath_global(td, vp, &rpath, &fbuf); + if (error != 0) { + vrele(vp); + return (error); + } + if (strlen(rpath) >= MNAMELEN) { + vrele(vp); + error = ENAMETOOLONG; + goto out; + } + + /* + * Re-lookup the vnode by path. As a side effect, the vnode is + * relocked. If vnode was renamed, return ENOENT. + */ + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, + UIO_SYSSPACE, fspath, td); + error = namei(&nd); + if (error != 0) { + vrele(vp); + goto out; + } + if (NDHASGIANT(&nd)) + mtx_unlock(&Giant); + NDFREE(&nd, NDF_ONLY_PNBUF); + vp1 = nd.ni_vp; + vrele(vp); + if (vp1 != vp) { + vput(vp1); + error = ENOENT; + goto out; + } + + strlcpy(fspath,rpath,MNAMELEN); +out: + free(fbuf, M_TEMP); + return (error); +} + +/* * Mount a filesystem. */ int @@ -745,6 +799,7 @@ static int vfs_domount_first( struct thread *td, /* Calling thread. */ struct vfsconf *vfsp, /* File system type. */ + char *fspath, /* Mount path. */ struct vnode *vp, /* Vnode to be covered. */ int fsflags, /* Flags common to all filesystems. */ struct vfsoptlist **optlist /* Options local to the filesystem. */ @@ -753,25 +808,12 @@ vfs_domount_first( struct vattr va; struct mount *mp; struct vnode *newdp; - char *fspath, *fbuf; int error; mtx_assert(&Giant, MA_OWNED); ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); - /* Construct global filesystem path from vp. */ - error = vn_fullpath_global(td, vp, &fspath, &fbuf); - if (error != 0) { - vput(vp); - return (error); - } - if (strlen(fspath) >= MNAMELEN) { - vput(vp); - free(fbuf, M_TEMP); - return (ENAMETOOLONG); - } - /* * If the user is not root, ensure that they own the directory * onto which we are attempting to mount. @@ -793,14 +835,12 @@ vfs_domount_first( } if (error != 0) { vput(vp); - free(fbuf, M_TEMP); return (error); } VOP_UNLOCK(vp, 0); /* Allocate and initialize the filesystem. */ mp = vfs_mount_alloc(vp, vfsp, fspath, td->td_ucred); - free(fbuf, M_TEMP); /* XXXMAC: pass to vfs_mount_alloc? */ mp->mnt_optnew = *optlist; /* Set the mount level flags. */ @@ -1083,15 +1123,15 @@ vfs_domount( mtx_lock(&Giant); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - if ((fsflags & MNT_UPDATE) == 0) - error = vfs_domount_first(td, vfsp, vp, fsflags, optlist); - else + if ((fsflags & MNT_UPDATE) == 0) { + error = vfs_verify_global_path(td, vp, fspath); + if (error == 0) + error = vfs_domount_first(td, vfsp, fspath, vp, + fsflags, optlist); + } else error = vfs_domount_update(td, vp, fsflags, optlist); mtx_unlock(&Giant); - ASSERT_VI_UNLOCKED(vp, __func__); - ASSERT_VOP_UNLOCKED(vp, __func__); - return (error); } @@ -1118,7 +1158,7 @@ unmount(td, uap) { struct mount *mp; struct nameidata nd; - char *pathbuf, *rpathbuf, *fbuf; + char *pathbuf; int error, id0, id1; AUDIT_ARG_VALUE(uap->flags); @@ -1163,16 +1203,13 @@ unmount(td, uap) FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, UIO_SYSSPACE, pathbuf, td); if (namei(&nd) == 0) { + if (NDHASGIANT(&nd)) + mtx_unlock(&Giant); NDFREE(&nd, NDF_ONLY_PNBUF); - if (vn_fullpath_global(td, nd.ni_vp, &rpathbuf, - &fbuf) == 0) { - if (strlen(rpathbuf) < MNAMELEN) { - strlcpy(pathbuf, rpathbuf, - MNAMELEN); - } - free(fbuf, M_TEMP); - } - vput(nd.ni_vp); + error = vfs_verify_global_path(td, nd.ni_vp, + pathbuf); + if (error == 0) + vput(nd.ni_vp); } } mtx_lock(&mountlist_mtx); From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 15:02:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ABDE106566B; Fri, 5 Aug 2011 15:02:18 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8B68FC0A; Fri, 5 Aug 2011 15:02:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75F2ICn010546; Fri, 5 Aug 2011 15:02:18 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75F2Iv2010544; Fri, 5 Aug 2011 15:02:18 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201108051502.p75F2Iv2010544@svn.freebsd.org> From: Ollivier Robert Date: Fri, 5 Aug 2011 15:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224656 - head/usr.sbin/bsdinstall/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 15:02:18 -0000 Author: roberto Date: Fri Aug 5 15:02:17 2011 New Revision: 224656 URL: http://svn.freebsd.org/changeset/base/224656 Log: Add back ftp4, a new machine has taken its place. ftp2 and ftp8 are both IPv6 capable mirrors. cvsup4/ftp4 have already been added to the handbook. Reviewed by: nathanw Approved by: re (kib) Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Fri Aug 5 11:12:50 2011 (r224655) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Fri Aug 5 15:02:17 2011 (r224656) @@ -84,11 +84,12 @@ MIRROR=`dialog --backtitle "FreeBSD Inst ftp://ftp.ee.freebsd.org "Estonia"\ ftp://ftp.fi.freebsd.org "Finland"\ ftp://ftp.fr.freebsd.org "France"\ - ftp://ftp2.fr.freebsd.org "France #2"\ + ftp://ftp2.fr.freebsd.org "IPv6 France #2"\ ftp://ftp3.fr.freebsd.org "France #3"\ + ftp://ftp4.fr.freebsd.org "France #4"\ ftp://ftp5.fr.freebsd.org "France #5"\ ftp://ftp6.fr.freebsd.org "France #6"\ - ftp://ftp8.fr.freebsd.org "France #8"\ + ftp://ftp8.fr.freebsd.org "IPv6 France #8"\ ftp://ftp.de.freebsd.org "Germany"\ ftp://ftp2.de.freebsd.org "Germany #2"\ ftp://ftp3.de.freebsd.org "Germany #3"\ From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 15:07:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D128F106566B; Fri, 5 Aug 2011 15:07:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1EA98FC17; Fri, 5 Aug 2011 15:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75F7SAp010726; Fri, 5 Aug 2011 15:07:28 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75F7SKf010724; Fri, 5 Aug 2011 15:07:28 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201108051507.p75F7SKf010724@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 5 Aug 2011 15:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224657 - head/usr.bin/catman X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 15:07:28 -0000 Author: uqs Date: Fri Aug 5 15:07:28 2011 New Revision: 224657 URL: http://svn.freebsd.org/changeset/base/224657 Log: For POLA reasons, disable SGR sequences in catpages. See r222647 for a similar change to bsd.doc.mk after SGR was generally turned on in groff. Suggested by: ru Approved by: re (kib) Modified: head/usr.bin/catman/catman.c Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Fri Aug 5 15:02:17 2011 (r224656) +++ head/usr.bin/catman/catman.c Fri Aug 5 15:07:28 2011 (r224657) @@ -432,7 +432,7 @@ process_page(char *mandir, char *src, ch } snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat); snprintf(cmd, sizeof cmd, - "%scat %s | tbl | nroff -T%s -man | %s > %s.tmp", + "%scat %s | tbl | nroff -c -T%s -man | %s > %s.tmp", zipped == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "", src, nroff_device, zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat", From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 17:33:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7369F106564A; Fri, 5 Aug 2011 17:33:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64C268FC18; Fri, 5 Aug 2011 17:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75HXCmT015028; Fri, 5 Aug 2011 17:33:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75HXCrZ015026; Fri, 5 Aug 2011 17:33:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201108051733.p75HXCrZ015026@svn.freebsd.org> From: Ed Schouten Date: Fri, 5 Aug 2011 17:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224659 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 17:33:12 -0000 Author: ed Date: Fri Aug 5 17:33:12 2011 New Revision: 224659 URL: http://svn.freebsd.org/changeset/base/224659 Log: Remove NIS entries from /etc/nsswitch.conf for WITHOUT_NIS. We already modify various configuration files in /etc based on build configuration. This is not done for nsswitch.conf right now when setting WITHOUT_NIS. This breaks various utilities, including crond, that depend on working databases. Approved by: re (kib) MFC after: 1 month Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Aug 5 17:15:46 2011 (r224658) +++ head/etc/Makefile Fri Aug 5 17:33:12 2011 (r224659) @@ -256,6 +256,10 @@ distribution: ${DESTDIR}/boot/device.hints .endif .endif +.if ${MK_NIS} == "no" + sed -i "" -e '/_compat:/d' -e 's/compat/files/' \ + ${DESTDIR}/etc/nsswitch.conf +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 17:43:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F4C1106566B; Fri, 5 Aug 2011 17:43:12 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 061DF8FC15; Fri, 5 Aug 2011 17:43:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75HhBE0015341; Fri, 5 Aug 2011 17:43:11 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75HhBo5015339; Fri, 5 Aug 2011 17:43:11 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108051743.p75HhBo5015339@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 5 Aug 2011 17:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224660 - head/tools/regression/security/cap_test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 17:43:12 -0000 Author: jonathan Date: Fri Aug 5 17:43:11 2011 New Revision: 224660 URL: http://svn.freebsd.org/changeset/base/224660 Log: Expect fchflags(2) to fail with EOPNOTSUPP on NFS. Even if we have CAP_FCHFLAGS, fchflags(2) fails on NFS. This is normal and expected, so don't fail the test because of it. Note that, whether or not we are on NFS, fchflags(2) should always fail with ENOTCAPABLE if we are using a capability that does not have the CAP_FCHFLAGS right. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_capabilities.c Fri Aug 5 17:33:12 2011 (r224659) +++ head/tools/regression/security/cap_test/cap_test_capabilities.c Fri Aug 5 17:43:11 2011 (r224660) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "cap_test.h" @@ -102,9 +103,13 @@ try_file_ops(int fd, cap_rights_t rights off_t off; void *p; char ch; - int ret; + int ret, is_nfs; int success = PASSED; + REQUIRE(fstatfs(fd, &sf)); + is_nfs = (strncmp("nfs", sf.f_fstypename, sizeof(sf.f_fstypename)) + == 0); + REQUIRE(fd_cap = cap_new(fd, rights)); REQUIRE(fd_capcap = cap_new(fd_cap, rights)); CHECK(fd_capcap != fd_cap); @@ -126,8 +131,12 @@ try_file_ops(int fd, cap_rights_t rights off = lseek(fd_cap, 0, SEEK_SET); CHECK_RESULT(lseek, CAP_SEEK, off >= 0); + /* + * Note: this is not expected to work over NFS. + */ ret = fchflags(fd_cap, UF_NODUMP); - CHECK_RESULT(fchflags, CAP_FCHFLAGS, ret == 0); + CHECK_RESULT(fchflags, CAP_FCHFLAGS, + (ret == 0) || (is_nfs && (errno == EOPNOTSUPP))); ret = fstat(fd_cap, &sb); CHECK_RESULT(fstat, CAP_FSTAT, ret == 0); From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 22:54:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 899DD1065672; Fri, 5 Aug 2011 22:54:42 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0C18FC08; Fri, 5 Aug 2011 22:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75MsgQx024450; Fri, 5 Aug 2011 22:54:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75MsgTa024447; Fri, 5 Aug 2011 22:54:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108052254.p75MsgTa024447@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 5 Aug 2011 22:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224661 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 22:54:42 -0000 Author: marcel Date: Fri Aug 5 22:54:42 2011 New Revision: 224661 URL: http://svn.freebsd.org/changeset/base/224661 Log: Make octeon_ap_boot 64 bits to handle MAXCPU up to 64. Better construction of CPU mask in platform_cpu_mask(). Release cores still in reset when platform_start_ap() is called. Reviewed by: imp, marcel Obtained from: Juniper Networks, Inc Author: Andrew Duane Approved by: re (kib) Modified: head/sys/mips/cavium/asm_octeon.S head/sys/mips/cavium/octeon_mp.c Modified: head/sys/mips/cavium/asm_octeon.S ============================================================================== --- head/sys/mips/cavium/asm_octeon.S Fri Aug 5 17:43:11 2011 (r224660) +++ head/sys/mips/cavium/asm_octeon.S Fri Aug 5 22:54:42 2011 (r224661) @@ -50,12 +50,12 @@ LEAF(octeon_ap_wait) jal platform_processor_id nop -1: ll t0, octeon_ap_boot +1: lld t0, octeon_ap_boot bne v0, t0, 1b nop move t0, zero - sc t0, octeon_ap_boot + scd t0, octeon_ap_boot beqz t0, 1b nop Modified: head/sys/mips/cavium/octeon_mp.c ============================================================================== --- head/sys/mips/cavium/octeon_mp.c Fri Aug 5 17:43:11 2011 (r224660) +++ head/sys/mips/cavium/octeon_mp.c Fri Aug 5 22:54:42 2011 (r224661) @@ -46,7 +46,8 @@ __FBSDID("$FreeBSD$"); /* XXX */ extern cvmx_bootinfo_t *octeon_bootinfo; -unsigned octeon_ap_boot = ~0; +/* NOTE: this 64-bit mask (and many others) limits MAXCPU to 64 */ +uint64_t octeon_ap_boot = ~0ULL; void platform_ipi_send(int cpuid) @@ -105,15 +106,13 @@ platform_init_ap(int cpuid) void platform_cpu_mask(cpuset_t *mask) { + uint64_t core_mask = octeon_bootinfo->core_mask; + uint64_t i, m; CPU_ZERO(mask); - - /* - * XXX: hack in order to simplify CPU set building, assuming that - * core_mask is 32-bits. - */ - memcpy(mask, &octeon_bootinfo->core_mask, - sizeof(octeon_bootinfo->core_mask)); + for (i = 0, m = 1 ; i < MAXCPU; i++, m <<= 1) + if (core_mask & m) + CPU_SET(i, mask); } struct cpu_group * @@ -125,11 +124,26 @@ platform_smp_topo(void) int platform_start_ap(int cpuid) { - if (atomic_cmpset_32(&octeon_ap_boot, ~0, cpuid) == 0) + uint64_t cores_in_reset; + + /* + * Release the core if it is in reset, and let it rev up a bit. + * The real synchronization happens below via octeon_ap_boot. + */ + cores_in_reset = cvmx_read_csr(CVMX_CIU_PP_RST); + if (cores_in_reset & (1ULL << cpuid)) { + if (bootverbose) + printf ("AP #%d still in reset\n", cpuid); + cores_in_reset &= ~(1ULL << cpuid); + cvmx_write_csr(CVMX_CIU_PP_RST, (uint64_t)(cores_in_reset)); + DELAY(2000); /* Give it a moment to start */ + } + + if (atomic_cmpset_64(&octeon_ap_boot, ~0, cpuid) == 0) return (-1); for (;;) { DELAY(1000); - if (atomic_cmpset_32(&octeon_ap_boot, 0, ~0) != 0) + if (atomic_cmpset_64(&octeon_ap_boot, 0, ~0) != 0) return (0); printf("Waiting for cpu%d to start\n", cpuid); } From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 23:05:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0174F106564A; Fri, 5 Aug 2011 23:05:47 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4CA38FC0A; Fri, 5 Aug 2011 23:05:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75N5kb3024810; Fri, 5 Aug 2011 23:05:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75N5kVw024808; Fri, 5 Aug 2011 23:05:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108052305.p75N5kVw024808@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 5 Aug 2011 23:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224662 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 23:05:47 -0000 Author: marcel Date: Fri Aug 5 23:05:46 2011 New Revision: 224662 URL: http://svn.freebsd.org/changeset/base/224662 Log: Remove stray semicolon in pmap_kextract() that turned the conditional "return (0)" into an unconditional one and as such broke PBVM address queries -- such as during kernel core dumps. Approved by: re (blanket) Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Fri Aug 5 22:54:42 2011 (r224661) +++ head/sys/ia64/ia64/pmap.c Fri Aug 5 23:05:46 2011 (r224662) @@ -1235,7 +1235,7 @@ pmap_kextract(vm_offset_t va) } /* PBVM page table. */ - if (va >= IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz); + if (va >= IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz) return (0); if (va >= IA64_PBVM_PGTBL) return (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl; From owner-svn-src-head@FreeBSD.ORG Fri Aug 5 23:10:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658C01065672; Fri, 5 Aug 2011 23:10:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B35B8FC12; Fri, 5 Aug 2011 23:10:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75NAmOq024981; Fri, 5 Aug 2011 23:10:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75NAm3C024979; Fri, 5 Aug 2011 23:10:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108052310.p75NAm3C024979@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 5 Aug 2011 23:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224663 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 23:10:48 -0000 Author: marcel Date: Fri Aug 5 23:10:47 2011 New Revision: 224663 URL: http://svn.freebsd.org/changeset/base/224663 Log: Follow-up commit: refactor pmap_kextract() to make it easier to catch and debug issues like the one fixed in the previous commit: Replace all return statements with goto statements so that we end up at a single place with a value for the physical address. Print a message for all unknown KVA addresses. Approved by: re (blanket) Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Fri Aug 5 23:05:46 2011 (r224662) +++ head/sys/ia64/ia64/pmap.c Fri Aug 5 23:10:47 2011 (r224663) @@ -1217,43 +1217,54 @@ pmap_kextract(vm_offset_t va) { struct ia64_lpte *pte; uint64_t *pbvm_pgtbl; + vm_paddr_t pa; u_int idx; KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA")); /* Regions 6 and 7 are direct mapped. */ - if (va >= IA64_RR_BASE(6)) - return (IA64_RR_MASK(va)); + if (va >= IA64_RR_BASE(6)) { + pa = IA64_RR_MASK(va); + goto out; + } - /* Bail out if the virtual address is beyond our limits. */ + /* Region 5 is our KVA. Bail out if the VA is beyond our limits. */ if (va >= kernel_vm_end) - return (0); - + goto err_out; if (va >= VM_MIN_KERNEL_ADDRESS) { pte = pmap_find_kpte(va); - return (pmap_present(pte) ? pmap_ppn(pte)|(va&PAGE_MASK) : 0); + pa = pmap_present(pte) ? pmap_ppn(pte) | (va & PAGE_MASK) : 0; + goto out; } - /* PBVM page table. */ + /* The PBVM page table. */ if (va >= IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz) - return (0); - if (va >= IA64_PBVM_PGTBL) - return (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl; + goto err_out; + if (va >= IA64_PBVM_PGTBL) { + pa = (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl; + goto out; + } - /* PBVM. */ + /* The PBVM itself. */ if (va >= IA64_PBVM_BASE) { pbvm_pgtbl = (void *)IA64_PBVM_PGTBL; idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT; if (idx >= (bootinfo->bi_pbvm_pgtblsz >> 3)) - return (0); + goto err_out; if ((pbvm_pgtbl[idx] & PTE_PRESENT) == 0) - return (0); - return ((pbvm_pgtbl[idx] & PTE_PPN_MASK) + - (va & IA64_PBVM_PAGE_MASK)); + goto err_out; + pa = (pbvm_pgtbl[idx] & PTE_PPN_MASK) + + (va & IA64_PBVM_PAGE_MASK); + goto out; } - printf("XXX: %s: va=%#lx\n", __func__, va); - return (0); + err_out: + printf("XXX: %s: va=%#lx is invalid\n", __func__, va); + pa = 0; + /* FALLTHROUGH */ + + out: + return (pa); } /* From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 03:40:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED671065672; Sat, 6 Aug 2011 03:40:34 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E7C88FC08; Sat, 6 Aug 2011 03:40:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p763eYPA033351; Sat, 6 Aug 2011 03:40:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p763eXAs033349; Sat, 6 Aug 2011 03:40:34 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108060340.p763eXAs033349@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 6 Aug 2011 03:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224668 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 03:40:34 -0000 Author: marcel Date: Sat Aug 6 03:40:33 2011 New Revision: 224668 URL: http://svn.freebsd.org/changeset/base/224668 Log: Fix kernel core dumps now that the kernel is using PBVM. The basic problem to solve is that we don't have a fixed mapping from kernel text to physical address so that libkvm can bootstrap itself. We solve this by passing the physical address of the bootinfo structure to the consumer as the entry point of the core file. This way, libkvm can extract the PBVM page table information and locate the kernel in the core file. We also need to dump memory chunks of type loader data, because those hold the kernel and the PBVM page table (among other things). Approved by: re (blanket) Modified: head/sys/ia64/ia64/dump_machdep.c Modified: head/sys/ia64/ia64/dump_machdep.c ============================================================================== --- head/sys/ia64/ia64/dump_machdep.c Sat Aug 6 00:45:33 2011 (r224667) +++ head/sys/ia64/ia64/dump_machdep.c Sat Aug 6 03:40:33 2011 (r224668) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #include #include @@ -191,7 +192,8 @@ foreach_chunk(callback_t cb, void *arg) seqnr = 0; mdp = efi_md_first(); while (mdp != NULL) { - if (mdp->md_type == EFI_MD_TYPE_FREE) { + if (mdp->md_type == EFI_MD_TYPE_FREE || + mdp->md_type == EFI_MD_TYPE_DATA) { error = (*cb)(mdp, seqnr++, arg); if (error) return (-error); @@ -225,6 +227,7 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; ehdr.e_machine = EM_IA_64; + ehdr.e_entry = ia64_tpa((uintptr_t)bootinfo); ehdr.e_phoff = sizeof(ehdr); ehdr.e_flags = EF_IA_64_ABSOLUTE; /* XXX misuse? */ ehdr.e_ehsize = sizeof(ehdr); From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 09:11:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 223F7106566B; Sat, 6 Aug 2011 09:11:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 126F38FC0C; Sat, 6 Aug 2011 09:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p769BUfl043237; Sat, 6 Aug 2011 09:11:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p769BU26043235; Sat, 6 Aug 2011 09:11:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108060911.p769BU26043235@svn.freebsd.org> From: Doug Barton Date: Sat, 6 Aug 2011 09:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224672 - head/usr.sbin/service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 09:11:31 -0000 Author: dougb Date: Sat Aug 6 09:11:30 2011 New Revision: 224672 URL: http://svn.freebsd.org/changeset/base/224672 Log: Fix a silly typo on my part. Approved by: re (hrs) Modified: head/usr.sbin/service/service.8 Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Sat Aug 6 07:01:16 2011 (r224671) +++ head/usr.sbin/service/service.8 Sat Aug 6 09:11:30 2011 (r224672) @@ -123,7 +123,7 @@ for the names of the rc.d scripts: .Sh HISTORY The .Nm -manual page service first appeared in +utility first appeared in .Fx 7.3 . .Sh AUTHORS This From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 09:13:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 742221065676; Sat, 6 Aug 2011 09:13:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644098FC14; Sat, 6 Aug 2011 09:13:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p769D9e1043321; Sat, 6 Aug 2011 09:13:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p769D9cS043319; Sat, 6 Aug 2011 09:13:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108060913.p769D9cS043319@svn.freebsd.org> From: Doug Barton Date: Sat, 6 Aug 2011 09:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224673 - head/sbin/rcorder X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 09:13:09 -0000 Author: dougb Date: Sat Aug 6 09:13:09 2011 New Revision: 224673 URL: http://svn.freebsd.org/changeset/base/224673 Log: Gavin documented these alternate options in good faith in r222751 based on the patch in the PR, however he was unaware that they were undocumented intentionally. This patch moves the information about these alternates into a comment which also explains why they are undocumented. Approved by: re (hrs) Modified: head/sbin/rcorder/rcorder.8 Modified: head/sbin/rcorder/rcorder.8 ============================================================================== --- head/sbin/rcorder/rcorder.8 Sat Aug 6 09:11:30 2011 (r224672) +++ head/sbin/rcorder/rcorder.8 Sat Aug 6 09:13:09 2011 (r224673) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2011 +.Dd August 5, 2011 .Dt RCORDER 8 .Os .Sh NAME @@ -89,12 +89,9 @@ and lines may appear, but all such lines must appear in a sequence without any intervening lines, as once a line that does not follow the format is reached, parsing stops. -Note that for historical reasons, -.Dq Li REQUIRES , -.Dq Li PROVIDES , -and -.Dq Li KEYWORDS -are also accepted in addition to the above. +.\" Note that for historical reasons REQUIRES, PROVIDES, and KEYWORDS +.\" are also accepted in addition to the above, but not documented so +.\" that they can be deprecated at some point in the future. .Pp The options are as follows: .Bl -tag -width indent From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 09:16:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96B2B106566B; Sat, 6 Aug 2011 09:16:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 870618FC08; Sat, 6 Aug 2011 09:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p769GrFF043465; Sat, 6 Aug 2011 09:16:53 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p769Gr4A043462; Sat, 6 Aug 2011 09:16:53 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108060916.p769Gr4A043462@svn.freebsd.org> From: Doug Barton Date: Sat, 6 Aug 2011 09:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224674 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 09:16:53 -0000 Author: dougb Date: Sat Aug 6 09:16:53 2011 New Revision: 224674 URL: http://svn.freebsd.org/changeset/base/224674 Log: Rather than edit the nsswitch.conf file based on ${MK_NIS} == "no" comment out the NIS _compat options by default, but leave them in the file for the convenience of users who want to enable it. Update the comment in the file accordingly. Reviewed by: ed Approved by: re (hrs) Modified: head/etc/Makefile head/etc/nsswitch.conf Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 6 09:13:09 2011 (r224673) +++ head/etc/Makefile Sat Aug 6 09:16:53 2011 (r224674) @@ -256,10 +256,6 @@ distribution: ${DESTDIR}/boot/device.hints .endif .endif -.if ${MK_NIS} == "no" - sed -i "" -e '/_compat:/d' -e 's/compat/files/' \ - ${DESTDIR}/etc/nsswitch.conf -.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ Modified: head/etc/nsswitch.conf ============================================================================== --- head/etc/nsswitch.conf Sat Aug 6 09:13:09 2011 (r224673) +++ head/etc/nsswitch.conf Sat Aug 6 09:16:53 2011 (r224674) @@ -1,15 +1,23 @@ # -# nsswitch.conf(5) - name service switch configuration file # $FreeBSD$ # -group: compat -group_compat: nis +# To enable NIS the commented entries should replace their uncommented +# equivalents. See nsswitch.conf(5) for more information. +# +group: files +#group_compat: nis +#group: compat + +passwd: files +#passwd_compat: nis +#passwd: compat + +services: files +#services_compat: nis +#services: compat + hosts: files dns networks: files -passwd: compat -passwd_compat: nis shells: files -services: compat -services_compat: nis protocols: files rpc: files From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 15:59:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C511065670; Sat, 6 Aug 2011 15:59:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9399C8FC15; Sat, 6 Aug 2011 15:59:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76FxsBu057904; Sat, 6 Aug 2011 15:59:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76FxsAT057902; Sat, 6 Aug 2011 15:59:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201108061559.p76FxsAT057902@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 6 Aug 2011 15:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224680 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 15:59:55 -0000 Author: marcel Date: Sat Aug 6 15:59:54 2011 New Revision: 224680 URL: http://svn.freebsd.org/changeset/base/224680 Log: Add support for PBVM addresses. In a nutshell this means: o get the physical address and size of the PBVM page table. This can be found in the bootinfo structure, of which the physical address is recorded as the ELF entry point. o translate region 4 virtual addresses to physical addresses using the PBVM page table. In _kvm_kvatop() make the distinction between physical address and core file offset a little clearer to avoid confusion. To further enhance readability, always store the translated address into pa so that it's obvious how the translation from va to pa happened. Approved by: re (blanket) Modified: head/lib/libkvm/kvm_ia64.c Modified: head/lib/libkvm/kvm_ia64.c ============================================================================== --- head/lib/libkvm/kvm_ia64.c Sat Aug 6 14:25:11 2011 (r224679) +++ head/lib/libkvm/kvm_ia64.c Sat Aug 6 15:59:54 2011 (r224680) @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -51,11 +52,16 @@ #define KPTE_DIR0_INDEX(va,ps) ((((va)/(ps)) / NKPTEPG(ps)) / NKPTEDIR(ps)) #define KPTE_DIR1_INDEX(va,ps) ((((va)/(ps)) / NKPTEPG(ps)) % NKPTEDIR(ps)) +#define PBVM_BASE 0x9ffc000000000000UL +#define PBVM_PGSZ (64 * 1024) + struct vmstate { void *mmapbase; size_t mmapsize; size_t pagesize; u_long kptdir; + u_long *pbvm_pgtbl; + u_int pbvm_pgtblsz; }; /* @@ -110,11 +116,28 @@ _kvm_pa2off(kvm_t *kd, uint64_t pa, off_ return (pgsz - ((size_t)pa & (pgsz - 1))); } +static ssize_t +_kvm_read_phys(kvm_t *kd, uint64_t pa, void *buf, size_t bufsz) +{ + off_t ofs; + size_t sz; + + sz = _kvm_pa2off(kd, pa, &ofs, 0); + if (sz < bufsz) + return ((ssize_t)sz); + + if (lseek(kd->pmfd, ofs, 0) == -1) + return (-1); + return (read(kd->pmfd, buf, bufsz)); +} + void _kvm_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; + if (vm->pbvm_pgtbl != NULL) + free(vm->pbvm_pgtbl); if (vm->mmapbase != NULL) munmap(vm->mmapbase, vm->mmapsize); free(vm); @@ -124,10 +147,12 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { + struct bootinfo bi; struct nlist nl[2]; uint64_t va; Elf64_Ehdr *ehdr; size_t hdrsz; + ssize_t sz; kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); if (kd->vmst == NULL) { @@ -146,6 +171,42 @@ _kvm_initvtop(kvm_t *kd) return (-1); /* + * Load the PBVM page table. We need this to resolve PBVM addresses. + * The PBVM page table is obtained from the bootinfo structure, of + * which the physical address is given to us in e_entry. If e_entry + * is 0, then this is assumed to be a pre-PBVM kernel. + */ + if (ehdr->e_entry != 0) { + sz = _kvm_read_phys(kd, ehdr->e_entry, &bi, sizeof(bi)); + if (sz != sizeof(bi)) { + _kvm_err(kd, kd->program, + "cannot read bootinfo from PA %#lx", ehdr->e_entry); + return (-1); + } + if (bi.bi_magic != BOOTINFO_MAGIC) { + _kvm_err(kd, kd->program, "invalid bootinfo"); + return (-1); + } + kd->vmst->pbvm_pgtbl = _kvm_malloc(kd, bi.bi_pbvm_pgtblsz); + if (kd->vmst->pbvm_pgtbl == NULL) { + _kvm_err(kd, kd->program, "cannot allocate page table"); + return (-1); + } + kd->vmst->pbvm_pgtblsz = bi.bi_pbvm_pgtblsz; + sz = _kvm_read_phys(kd, bi.bi_pbvm_pgtbl, kd->vmst->pbvm_pgtbl, + bi.bi_pbvm_pgtblsz); + if (sz != bi.bi_pbvm_pgtblsz) { + _kvm_err(kd, kd->program, + "cannot read page table from PA %#lx", + bi.bi_pbvm_pgtbl); + return (-1); + } + } else { + kd->vmst->pbvm_pgtbl = NULL; + kd->vmst->pbvm_pgtblsz = 0; + } + + /* * At this point we've got enough information to use kvm_read() for * direct mapped (ie region 6 and region 7) address, such as symbol * addresses/values. @@ -174,17 +235,18 @@ _kvm_initvtop(kvm_t *kd) } int -_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) +_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs) { struct ia64_lpte pte; - uint64_t pgaddr, pt0addr, pt1addr; + uint64_t pa, pgaddr, pt0addr, pt1addr; size_t pgno, pgsz, pt0no, pt1no; if (va >= REGION_BASE(6)) { /* Regions 6 and 7: direct mapped. */ - return (_kvm_pa2off(kd, REGION_ADDR(va), pa, 0)); + pa = REGION_ADDR(va); + return (_kvm_pa2off(kd, pa, ofs, 0)); } else if (va >= REGION_BASE(5)) { - /* Region 5: virtual. */ + /* Region 5: Kernel Virtual Memory. */ va = REGION_ADDR(va); pgsz = kd->vmst->pagesize; pt0no = KPTE_DIR0_INDEX(va, pgsz); @@ -207,12 +269,24 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t goto fail; if (!(pte.pte & PTE_PRESENT)) goto fail; - va = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1)); - return (_kvm_pa2off(kd, va, pa, pgsz)); + pa = (pte.pte & PTE_PPN_MASK) + (va & (pgsz - 1)); + return (_kvm_pa2off(kd, pa, ofs, pgsz)); + } else if (va >= PBVM_BASE) { + /* Region 4: Pre-Boot Virtual Memory (PBVM). */ + va -= PBVM_BASE; + pgsz = PBVM_PGSZ; + pt0no = va / pgsz; + if (pt0no >= (kd->vmst->pbvm_pgtblsz >> 3)) + goto fail; + pt0addr = kd->vmst->pbvm_pgtbl[pt0no]; + if (!(pt0addr & PTE_PRESENT)) + goto fail; + pa = (pt0addr & PTE_PPN_MASK) + va % pgsz; + return (_kvm_pa2off(kd, pa, ofs, pgsz)); } fail: _kvm_err(kd, kd->program, "invalid kernel virtual address"); - *pa = ~0UL; + *ofs = ~0UL; return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:45:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDCA106566C; Sat, 6 Aug 2011 17:45:12 +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 F295E8FC08; Sat, 6 Aug 2011 17:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76HjBFJ061097; Sat, 6 Aug 2011 17:45:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76HjBXo061095; Sat, 6 Aug 2011 17:45:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061745.p76HjBXo061095@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224681 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:45:12 -0000 Author: marius Date: Sat Aug 6 17:45:11 2011 New Revision: 224681 URL: http://svn.freebsd.org/changeset/base/224681 Log: Remove a shortcut which is invalid with MAXCPU > IDR_CHEETAH_MAX_BN_PAIRS. Approved by: re (kib) Modified: head/sys/sparc64/sparc64/mp_machdep.c Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Sat Aug 6 15:59:54 2011 (r224680) +++ head/sys/sparc64/sparc64/mp_machdep.c Sat Aug 6 17:45:11 2011 (r224681) @@ -702,9 +702,6 @@ cheetah_ipi_selected(cpuset_t cpus, u_lo IDR_CHEETAH_ALL_BUSY) != 0) ; intr_restore(s); - if ((ids & - (IDR_CHEETAH_ALL_BUSY | IDR_CHEETAH_ALL_NACK)) == 0) - return; bnp = 0; for (cpu = 0; cpu < mp_ncpus; cpu++) { if (CPU_ISSET(cpu, &cpus)) { @@ -713,11 +710,6 @@ cheetah_ipi_selected(cpuset_t cpus, u_lo bnp++; } } - /* - * On at least Fire V880 we may receive IDR_NACKs for - * CPUs we actually haven't tried to send an IPI to, - * but which apparently can be safely ignored. - */ if (CPU_EMPTY(&cpus)) return; /* From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:45:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084DB1065676; Sat, 6 Aug 2011 17:45:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC04E8FC14; Sat, 6 Aug 2011 17:45:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76HjqZx061151; Sat, 6 Aug 2011 17:45:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76HjqF4061149; Sat, 6 Aug 2011 17:45:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061745.p76HjqF4061149@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224682 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:45:53 -0000 Author: marius Date: Sat Aug 6 17:45:52 2011 New Revision: 224682 URL: http://svn.freebsd.org/changeset/base/224682 Log: - Merge from r147740: When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. - Use __FBSDID. - Wrap a too long line. Approved by: re (kib) MFC after: 1 week Modified: head/sys/sparc64/sparc64/dump_machdep.c Modified: head/sys/sparc64/sparc64/dump_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/dump_machdep.c Sat Aug 6 17:45:11 2011 (r224681) +++ head/sys/sparc64/sparc64/dump_machdep.c Sat Aug 6 17:45:52 2011 (r224682) @@ -23,10 +23,11 @@ * 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$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -92,6 +93,7 @@ buf_flush(struct dumperinfo *di) error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); dumplo += DEV_BSIZE; + fragsz = 0; return (error); } @@ -169,7 +171,8 @@ dumpsys(struct dumperinfo *di) /* Determine dump offset on device. */ dumplo = di->mediaoffset + di->mediasize - totsize; - mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, + di->blocksize); printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:48:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2D43106566B; Sat, 6 Aug 2011 17:48:30 +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 A90B08FC13; Sat, 6 Aug 2011 17:48:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76HmUAb061261; Sat, 6 Aug 2011 17:48:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76HmUbM061259; Sat, 6 Aug 2011 17:48:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061748.p76HmUbM061259@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:48:30 -0000 Author: marius Date: Sat Aug 6 17:48:30 2011 New Revision: 224683 URL: http://svn.freebsd.org/changeset/base/224683 Log: The tid member of struct pthread actually is long so read it as such. Accessing it as an int causes failure on big-endian LP64, i.e. mips64be, powerpc64 and sparc64. Reviewed by: marcel Approved by: re (kib) MFC after: 1 week Modified: head/lib/libthread_db/libthr_db.c Modified: head/lib/libthread_db/libthr_db.c ============================================================================== --- head/lib/libthread_db/libthr_db.c Sat Aug 6 17:45:52 2011 (r224682) +++ head/lib/libthread_db/libthr_db.c Sat Aug 6 17:48:30 2011 (r224683) @@ -202,7 +202,7 @@ static td_err_e pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th) { psaddr_t pt; - int32_t lwp; + long lwp; int ret; TDBG_FUNC(); @@ -214,7 +214,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta return (TD_ERR); /* Iterate through thread list to find pthread */ while (pt != 0) { - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); if (lwp == id) @@ -245,7 +245,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, { td_thrhandle_t th; psaddr_t pt; - int32_t lwp; + long lwp; int ret; TDBG_FUNC(); @@ -254,7 +254,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, if (ret != 0) return (TD_ERR); while (pt != 0) { - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); if (lwp != 0 && lwp != TERMINATED) { @@ -368,7 +368,7 @@ pt_ta_event_getmsg(const td_thragent_t * psaddr_t pt; td_thr_events_e tmp; - int32_t lwp; + long lwp; int ret; TDBG_FUNC(); @@ -395,7 +395,7 @@ pt_ta_event_getmsg(const td_thragent_t * ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp)); /* Convert event */ pt = msg->th_p; - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); handle.th_ta = ta; @@ -672,7 +672,7 @@ pt_thr_event_getmsg(const td_thrhandle_t static td_thrhandle_t handle; const td_thragent_t *ta = th->th_ta; psaddr_t pt, pt_temp; - int32_t lwp; + long lwp; int ret; td_thr_events_e tmp; @@ -699,7 +699,7 @@ pt_thr_event_getmsg(const td_thrhandle_t ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp)); /* Convert event */ pt = msg->th_p; - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); handle.th_ta = ta; From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:49:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B775B1065670; Sat, 6 Aug 2011 17:49:21 +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 A70C98FC1A; Sat, 6 Aug 2011 17:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76HnLC3061323; Sat, 6 Aug 2011 17:49:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76HnLPq061321; Sat, 6 Aug 2011 17:49:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061749.p76HnLPq061321@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224684 - head/lib/libthread_db/arch/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:49:21 -0000 Author: marius Date: Sat Aug 6 17:49:21 2011 New Revision: 224684 URL: http://svn.freebsd.org/changeset/base/224684 Log: Use the size of struct fpreg rather than of the pointer to it when copying the FPU state. Reviewed by: marcel Approved by: re (kib) MFC after: 1 week Modified: head/lib/libthread_db/arch/amd64/libpthread_md.c Modified: head/lib/libthread_db/arch/amd64/libpthread_md.c ============================================================================== --- head/lib/libthread_db/arch/amd64/libpthread_md.c Sat Aug 6 17:48:30 2011 (r224683) +++ head/lib/libthread_db/arch/amd64/libpthread_md.c Sat Aug 6 17:49:21 2011 (r224684) @@ -92,18 +92,21 @@ pt_ucontext_to_reg(const ucontext_t *uc, void pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { - memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(r)); + + memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(*r)); } void pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { - memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(r)); + + memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(*r)); } void pt_md_init(void) { + /* Nothing to do */ } From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:50:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32FA91065672; Sat, 6 Aug 2011 17:50:38 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 091CB8FC22; Sat, 6 Aug 2011 17:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76Hob78061397; Sat, 6 Aug 2011 17:50:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76Hoblk061395; Sat, 6 Aug 2011 17:50:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061750.p76Hoblk061395@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224685 - head/lib/libthread_db/arch/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:50:38 -0000 Author: marius Date: Sat Aug 6 17:50:37 2011 New Revision: 224685 URL: http://svn.freebsd.org/changeset/base/224685 Log: Implement Reviewed by: marcel Approved by: re (kib) MFC after: 1 week Modified: head/lib/libthread_db/arch/sparc64/libpthread_md.c Modified: head/lib/libthread_db/arch/sparc64/libpthread_md.c ============================================================================== --- head/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 6 17:49:21 2011 (r224684) +++ head/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 6 17:50:37 2011 (r224685) @@ -1,5 +1,6 @@ /* * Copyright (c) 2004 Marcel Moolenaar + * Copyright (c) 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,39 +28,63 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include +#include #include "libpthread_db.h" void -pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused) +pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc) { + + memcpy(&uc->uc_mcontext, r, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused) +pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) { + + memcpy(r, &uc->uc_mcontext, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused) +pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { + mcontext_t *mc = &uc->uc_mcontext; + + memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + mc->mc_fsr = r->fr_fsr; + mc->mc_gsr = r->fr_gsr; + mc->mc_fprs |= FPRS_FEF; } void -pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused) +pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { + const mcontext_t *mc = &uc->uc_mcontext; + + if ((mc->mc_fprs & FPRS_FEF) != 0) { + memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + r->fr_fsr = mc->mc_fsr; + r->fr_gsr = mc->mc_gsr; + } else + memset(r, 0, sizeof(*r)); } void pt_md_init(void) { + } int pt_reg_sstep(struct reg *reg __unused, int step __unused) { + return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:52:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C2AF106566C; Sat, 6 Aug 2011 17:52:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 123ED8FC19; Sat, 6 Aug 2011 17:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76HqPx7061488; Sat, 6 Aug 2011 17:52:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76HqPKD061485; Sat, 6 Aug 2011 17:52:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061752.p76HqPKD061485@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224686 - in head/contrib/gdb: . gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:52:26 -0000 Author: marius Date: Sat Aug 6 17:52:25 2011 New Revision: 224686 URL: http://svn.freebsd.org/changeset/base/224686 Log: Implement functions necessary for compiling fbsd-threads.c. Reviewed by: marcel Approved by: re (kib) MFC after: 1 week Modified: head/contrib/gdb/FREEBSD-diffs head/contrib/gdb/gdb/sparc64fbsd-tdep.c Modified: head/contrib/gdb/FREEBSD-diffs ============================================================================== --- head/contrib/gdb/FREEBSD-diffs Sat Aug 6 17:50:37 2011 (r224685) +++ head/contrib/gdb/FREEBSD-diffs Sat Aug 6 17:52:25 2011 (r224686) @@ -927,3 +927,39 @@ diff -N gdb/config/ia64/tm-fbsd.h +#include "ia64/tm-ia64.h" + +#endif /* TM_FBSD_H */ +Index: gdb/sparc64fbsd-tdep.c +=================================================================== +--- gdb/sparc64fbsd-tdep.c (revision 223862) ++++ gdb/sparc64fbsd-tdep.c (working copy) +@@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struct regset * + { + sparc64_supply_fpregset (regcache, regnum, fpregs); + } ++ ++void ++supply_gregset (const void *gregs) ++{ ++ sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); ++} ++ ++void ++supply_fpregset (const void *fpregs) ++{ ++ sparc64_supply_fpregset (current_regcache, -1, fpregs); ++} ++ ++void ++fill_gregset (void *gregs, int regnum) ++{ ++ sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, ++ gregs); ++} ++ ++void ++fill_fpregset (void *fpregs, int regnum) ++{ ++ sparc64_collect_fpregset (current_regcache, regnum, fpregs); ++} + + + /* Signal trampolines. */ Modified: head/contrib/gdb/gdb/sparc64fbsd-tdep.c ============================================================================== --- head/contrib/gdb/gdb/sparc64fbsd-tdep.c Sat Aug 6 17:50:37 2011 (r224685) +++ head/contrib/gdb/gdb/sparc64fbsd-tdep.c Sat Aug 6 17:52:25 2011 (r224686) @@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struc { sparc64_supply_fpregset (regcache, regnum, fpregs); } + +void +supply_gregset (const void *gregs) +{ + sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); +} + +void +supply_fpregset (const void *fpregs) +{ + sparc64_supply_fpregset (current_regcache, -1, fpregs); +} + +void +fill_gregset (void *gregs, int regnum) +{ + sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, + gregs); +} + +void +fill_fpregset (void *fpregs, int regnum) +{ + sparc64_collect_fpregset (current_regcache, regnum, fpregs); +} /* Signal trampolines. */ From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 17:53:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF903106566B; Sat, 6 Aug 2011 17:53:45 +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 AEEE78FC08; Sat, 6 Aug 2011 17:53:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76HrjBt061560; Sat, 6 Aug 2011 17:53:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76HrjN7061557; Sat, 6 Aug 2011 17:53:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108061753.p76HrjN7061557@svn.freebsd.org> From: Marius Strobl Date: Sat, 6 Aug 2011 17:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224687 - head/gnu/usr.bin/gdb/arch/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 17:53:45 -0000 Author: marius Date: Sat Aug 6 17:53:45 2011 New Revision: 224687 URL: http://svn.freebsd.org/changeset/base/224687 Log: Compile fbsd-threads.c. Amongst others this is necessary for a working kgdb(1). Reviewed by: marcel Approved by: re (kib) MFC after: 1 week Modified: head/gnu/usr.bin/gdb/arch/sparc64/Makefile head/gnu/usr.bin/gdb/arch/sparc64/init.c Modified: head/gnu/usr.bin/gdb/arch/sparc64/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/arch/sparc64/Makefile Sat Aug 6 17:52:25 2011 (r224686) +++ head/gnu/usr.bin/gdb/arch/sparc64/Makefile Sat Aug 6 17:53:45 2011 (r224687) @@ -1,6 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) +LIBSRCS+= fbsd-threads.c LIBSRCS+= solib.c solib-legacy.c solib-svr4.c LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c .endif Modified: head/gnu/usr.bin/gdb/arch/sparc64/init.c ============================================================================== --- head/gnu/usr.bin/gdb/arch/sparc64/init.c Sat Aug 6 17:52:25 2011 (r224686) +++ head/gnu/usr.bin/gdb/arch/sparc64/init.c Sat Aug 6 17:53:45 2011 (r224687) @@ -11,6 +11,7 @@ extern initialize_file_ftype _initialize extern initialize_file_ftype _initialize_ser_hardwire; extern initialize_file_ftype _initialize_ser_pipe; extern initialize_file_ftype _initialize_ser_tcp; +extern initialize_file_ftype _initialize_thread_db; extern initialize_file_ftype _initialize_sparc64fbsd_nat; extern initialize_file_ftype _initialize_sparc64_nat; extern initialize_file_ftype _initialize_sparc_nat; @@ -124,6 +125,7 @@ initialize_all_files (void) _initialize_ser_pipe (); _initialize_ser_tcp (); #ifndef CROSS_DEBUGGER + _initialize_thread_db (); _initialize_sparc64fbsd_nat (); _initialize_sparc64_nat (); _initialize_sparc_nat (); From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 19:20:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61614106564A; Sat, 6 Aug 2011 19:20:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50DCF8FC15; Sat, 6 Aug 2011 19:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76JKHY7064099; Sat, 6 Aug 2011 19:20:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76JKHDe064097; Sat, 6 Aug 2011 19:20:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108061920.p76JKHDe064097@svn.freebsd.org> From: Robert Watson Date: Sat, 6 Aug 2011 19:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224688 - head/tools/regression/netinet/tcpdrop X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 19:20:17 -0000 Author: rwatson Date: Sat Aug 6 19:20:17 2011 New Revision: 224688 URL: http://svn.freebsd.org/changeset/base/224688 Log: Properly initialise the "len" argument to getsockname(2) in the tcpdrop regression test so that it works (more) consistently. Approved by: re (bz) Sponsored by: Juniper Networks Modified: head/tools/regression/netinet/tcpdrop/tcpdrop.c Modified: head/tools/regression/netinet/tcpdrop/tcpdrop.c ============================================================================== --- head/tools/regression/netinet/tcpdrop/tcpdrop.c Sat Aug 6 17:53:45 2011 (r224687) +++ head/tools/regression/netinet/tcpdrop/tcpdrop.c Sat Aug 6 19:20:17 2011 (r224688) @@ -233,6 +233,7 @@ main(int argc, char *argv[]) bzero(&sin, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); + len = sizeof(sin); if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0) err(-1, "getsockname"); port = sin.sin_port; From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 20:50:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2C38106566C; Sat, 6 Aug 2011 20:50:07 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward14.mail.yandex.net (forward14.mail.yandex.net [95.108.130.92]) by mx1.freebsd.org (Postfix) with ESMTP id 28E3B8FC0A; Sat, 6 Aug 2011 20:50:06 +0000 (UTC) Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward14.mail.yandex.net (Yandex) with ESMTP id 15322198229A; Sun, 7 Aug 2011 00:34:49 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1312662889; bh=DgUX09yC1/1giJCZls28+KxauYqoy9hGV2AgNZ+eba0=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=t4jZPZxLAlJi6Q1rN2dxaxJo0dV4jSrM4sQWD/sN7/iY+lJEv+pX8AzWU+kB5TZoM 8u4WDxQp0h1Kr5JgCQz7Q3eN54/PyodHCQTkto7JdZbOuuAbAqDRx6gZW+TqfZcJTU 0NK/XGcF8msYDxmEbrr8eeMnn4kFZACosZF+g6MY= Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id E3BB07E033F; Sun, 7 Aug 2011 00:34:48 +0400 (MSD) Received: from unknown (unknown [178.76.212.172]) by smtp11.mail.yandex.net (nwsmtp/Yandex) with ESMTP id YmlSlFka; Sun, 7 Aug 2011 00:34:48 +0400 X-Yandex-Spam: 1 Message-ID: <4E3DA560.6020100@yandex.ru> Date: Sun, 07 Aug 2011 00:34:40 +0400 From: Ruslan Mahmatkhanov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:5.0) Gecko/20110701 Thunderbird/5.0 MIME-Version: 1.0 To: Marius Strobl References: <201108061748.p76HmUbM061259@svn.freebsd.org> In-Reply-To: <201108061748.p76HmUbM061259@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 20:50:07 -0000 Marius Strobl wrote on 06.08.2011 21:48: > Author: marius > Date: Sat Aug 6 17:48:30 2011 > New Revision: 224683 > URL: http://svn.freebsd.org/changeset/base/224683 > > Log: > The tid member of struct pthread actually is long so read it as such. > Accessing it as an int causes failure on big-endian LP64, i.e. mips64be, > powerpc64 and sparc64. > > Reviewed by: marcel > Approved by: re (kib) > MFC after: 1 week > > Modified: > head/lib/libthread_db/libthr_db.c > Hi. Seems like this or related libthread_db commit breaks the build on i386: ===> lib/libthr (all) ===> lib/libthread_db (all) cc -O2 -pipe -I. -I/usr/src/lib/libthread_db -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/lib/libthread_db/thread_db.c cc -O2 -pipe -I. -I/usr/src/lib/libthread_db -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/lib/libthread_db/arch/i386/libpthread_md.c cc -O2 -pipe -I. -I/usr/src/lib/libthread_db -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/lib/libthread_db/libpthread_db.c cc -O2 -pipe -I. -I/usr/src/lib/libthread_db -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/lib/libthread_db/libthr_db.c cc1: warnings being treated as errors /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_ta_map_id2thr': /usr/src/lib/libthread_db/libthr_db.c:217: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_ta_thr_iter': /usr/src/lib/libthread_db/libthr_db.c:257: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_ta_event_getmsg': /usr/src/lib/libthread_db/libthr_db.c:398: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_thr_event_getmsg': /usr/src/lib/libthread_db/libthr_db.c:702: warning: passing argument 3 of 'thr_pread_long' from incompatible pointer type -- Regards, Ruslan From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 22:06:56 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68793106566B; Sat, 6 Aug 2011 22:06:56 +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 21AE18FC0C; Sat, 6 Aug 2011 22:06:54 +0000 (UTC) Received: from porto.starpoint.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 BAA09508; Sun, 07 Aug 2011 01:06:51 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Qpp18-0005Eo-NB; Sun, 07 Aug 2011 01:06:50 +0300 Message-ID: <4E3DBAF8.5040102@FreeBSD.org> Date: Sun, 07 Aug 2011 01:06:48 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Garrett Cooper , Marius Strobl References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> In-Reply-To: X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Mahmatkhanov Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 22:06:56 -0000 on 07/08/2011 00:41 Garrett Cooper said the following: > It's not just i386. It's other architectures like arm, mips, and pc98 > according to the tinderbox reports (this list is potentially > incomplete). Yeah, confusingly enough thr_pread_long() is declared to take uint64_t* as its third argument, so this commit breaks all platforms where uint64_t is not derived from (unsigned) long. Just in case, thr_pread_int() takes uint32_t* as well. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 22:07:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2D20106566C; Sat, 6 Aug 2011 22:07:51 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5A1EA8FC0C; Sat, 6 Aug 2011 22:07:51 +0000 (UTC) Received: by vws18 with SMTP id 18so1665520vws.13 for ; Sat, 06 Aug 2011 15:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=g338jJKC3BrAN90s420DB2OKQeIdIG0Hk1DKODVeRoc=; b=rFVww9vzK7fIBrkUHODhN4kgHIA2Vrt8Soxo48J0LRnDL3GtruJMMYIW0L+qWMil6l 9dwmuFMw4r/VTci/8qVR7BvaOLcQZmpIOHPnKXjOO9awORzqXAkBUpPMty4VyWkQljoH T2pPzQ92UfBkt6HChjMG/Eo6tHAzTg3mKETmo= MIME-Version: 1.0 Received: by 10.220.84.65 with SMTP id i1mr1170032vcl.54.1312666888668; Sat, 06 Aug 2011 14:41:28 -0700 (PDT) Received: by 10.220.172.18 with HTTP; Sat, 6 Aug 2011 14:41:28 -0700 (PDT) In-Reply-To: <4E3DA560.6020100@yandex.ru> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> Date: Sat, 6 Aug 2011 14:41:28 -0700 Message-ID: From: Garrett Cooper To: Ruslan Mahmatkhanov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Marius Strobl , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 22:07:51 -0000 On Sat, Aug 6, 2011 at 1:34 PM, Ruslan Mahmatkhanov wro= te: > Marius Strobl wrote on 06.08.2011 21:48: >> >> Author: marius >> Date: Sat Aug =A06 17:48:30 2011 >> New Revision: 224683 >> URL: http://svn.freebsd.org/changeset/base/224683 >> >> Log: >> =A0 The tid member of struct pthread actually is long so read it as such= . >> =A0 Accessing it as an int causes failure on big-endian LP64, i.e. mips6= 4be, >> =A0 powerpc64 and sparc64. >> >> =A0 Reviewed by: marcel >> =A0 Approved by: re (kib) >> =A0 MFC after: =A0 1 week >> >> Modified: >> =A0 head/lib/libthread_db/libthr_db.c >> > > Hi. > Seems like this or related libthread_db commit breaks the build on i386: > > =3D=3D=3D> lib/libthr (all) > =3D=3D=3D> lib/libthread_db (all) > cc -O2 -pipe =A0-I. -I/usr/src/lib/libthread_db -std=3Dgnu99 -fstack-prot= ector > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter > -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decl= s > -Wold-style-definition -Wno-pointer-sign -c > /usr/src/lib/libthread_db/thread_db.c > cc -O2 -pipe =A0-I. -I/usr/src/lib/libthread_db -std=3Dgnu99 -fstack-prot= ector > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter > -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decl= s > -Wold-style-definition -Wno-pointer-sign -c > /usr/src/lib/libthread_db/arch/i386/libpthread_md.c > cc -O2 -pipe =A0-I. -I/usr/src/lib/libthread_db -std=3Dgnu99 -fstack-prot= ector > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter > -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decl= s > -Wold-style-definition -Wno-pointer-sign -c > /usr/src/lib/libthread_db/libpthread_db.c > cc -O2 -pipe =A0-I. -I/usr/src/lib/libthread_db -std=3Dgnu99 -fstack-prot= ector > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter > -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decl= s > -Wold-style-definition -Wno-pointer-sign -c > /usr/src/lib/libthread_db/libthr_db.c > cc1: warnings being treated as errors > /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_ta_map_id2thr': > /usr/src/lib/libthread_db/libthr_db.c:217: warning: passing argument 3 of > 'thr_pread_long' from incompatible pointer type > /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_ta_thr_iter': > /usr/src/lib/libthread_db/libthr_db.c:257: warning: passing argument 3 of > 'thr_pread_long' from incompatible pointer type > /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_ta_event_getmsg': > /usr/src/lib/libthread_db/libthr_db.c:398: warning: passing argument 3 of > 'thr_pread_long' from incompatible pointer type > /usr/src/lib/libthread_db/libthr_db.c: In function 'pt_thr_event_getmsg': > /usr/src/lib/libthread_db/libthr_db.c:702: warning: passing argument 3 of > 'thr_pread_long' from incompatible pointer type It's not just i386. It's other architectures like arm, mips, and pc98 according to the tinderbox reports (this list is potentially incomplete). -Garett From owner-svn-src-head@FreeBSD.ORG Sat Aug 6 23:24:17 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96B2B1065676; Sat, 6 Aug 2011 23:24:17 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE548FC13; Sat, 6 Aug 2011 23:24:16 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p76NOFa6041474; Sun, 7 Aug 2011 01:24:16 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p76NOFex041473; Sun, 7 Aug 2011 01:24:15 +0200 (CEST) (envelope-from marius) Date: Sun, 7 Aug 2011 01:24:15 +0200 From: Marius Strobl To: Andriy Gapon Message-ID: <20110806232415.GE48988@alchemy.franken.de> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> <4E3DBAF8.5040102@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E3DBAF8.5040102@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: Garrett Cooper , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Mahmatkhanov Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 23:24:17 -0000 On Sun, Aug 07, 2011 at 01:06:48AM +0300, Andriy Gapon wrote: > on 07/08/2011 00:41 Garrett Cooper said the following: > > It's not just i386. It's other architectures like arm, mips, and pc98 > > according to the tinderbox reports (this list is potentially > > incomplete). > > Yeah, confusingly enough thr_pread_long() is declared to take uint64_t* as its > third argument, so this commit breaks all platforms where uint64_t is not > derived from (unsigned) long. > Just in case, thr_pread_int() takes uint32_t* as well. > Yes, the type of val is wrong. I'm currently running a fix through a universe build Marius