From owner-svn-src-stable@FreeBSD.ORG Sun Jul 10 22:09:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 006111065740; Sun, 10 Jul 2011 22:09:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3FD88FC15; Sun, 10 Jul 2011 22:09: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 p6AM9YMf063484; Sun, 10 Jul 2011 22:09:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6AM9Y1S063482; Sun, 10 Jul 2011 22:09:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107102209.p6AM9Y1S063482@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 10 Jul 2011 22:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223915 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2011 22:09:35 -0000 Author: yongari Date: Sun Jul 10 22:09:34 2011 New Revision: 223915 URL: http://svn.freebsd.org/changeset/base/223915 Log: MFC r223683: Document two known hardware errata which requires manual link configuration. Submitted by: Aries Lee (arieslee <> jmicron com) Modified: stable/8/share/man/man4/jme.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/jme.4 ============================================================================== --- stable/8/share/man/man4/jme.4 Sun Jul 10 20:49:13 2011 (r223914) +++ stable/8/share/man/man4/jme.4 Sun Jul 10 22:09:34 2011 (r223915) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2010 +.Dd June 29, 2011 .Dt JME 4 .Os .Sh NAME @@ -178,3 +178,17 @@ address once station address is reprogra It is highly recommended not to reprogram station address and it is responsibility of administrator to store original station address into a safe place when station address should be changed. +.Pp +There are two known 1000baseT link establishment issues with JMC25x. +If the full mask revision number of JMC25x controller is less than +or equal to 4 and link partner enabled IEEE 802.3az Energy Efficient +Ethernet feature, the controller would not be able to establish a +1000baseT link. +Also if the length of cable is longer than 120 meters, controller +can not establish a 1000baseT link. +The known workaround for the issue is to force manual link +configuration with 100baseTX instead of relying on auto-negotiation. +The full mask revision number of controller could be checked with +verbose kernel boot option. +Use lower nibble of chip revision number to get full mask revision of +the controller. From owner-svn-src-stable@FreeBSD.ORG Sun Jul 10 22:09:54 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A1F10656D4; Sun, 10 Jul 2011 22:09:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 204418FC22; Sun, 10 Jul 2011 22:09: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 p6AM9s8A063530; Sun, 10 Jul 2011 22:09:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6AM9sqQ063528; Sun, 10 Jul 2011 22:09:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107102209.p6AM9sqQ063528@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 10 Jul 2011 22:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223916 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2011 22:09:54 -0000 Author: yongari Date: Sun Jul 10 22:09:53 2011 New Revision: 223916 URL: http://svn.freebsd.org/changeset/base/223916 Log: MFC r223683: Document two known hardware errata which requires manual link configuration. Submitted by: Aries Lee (arieslee <> jmicron com) Modified: stable/7/share/man/man4/jme.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/jme.4 ============================================================================== --- stable/7/share/man/man4/jme.4 Sun Jul 10 22:09:34 2011 (r223915) +++ stable/7/share/man/man4/jme.4 Sun Jul 10 22:09:53 2011 (r223916) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2010 +.Dd June 29, 2011 .Dt JME 4 .Os .Sh NAME @@ -178,3 +178,17 @@ address once station address is reprogra It is highly recommended not to reprogram station address and it is responsibility of administrator to store original station address into a safe place when station address should be changed. +.Pp +There are two known 1000baseT link establishment issues with JMC25x. +If the full mask revision number of JMC25x controller is less than +or equal to 4 and link partner enabled IEEE 802.3az Energy Efficient +Ethernet feature, the controller would not be able to establish a +1000baseT link. +Also if the length of cable is longer than 120 meters, controller +can not establish a 1000baseT link. +The known workaround for the issue is to force manual link +configuration with 100baseTX instead of relying on auto-negotiation. +The full mask revision number of controller could be checked with +verbose kernel boot option. +Use lower nibble of chip revision number to get full mask revision of +the controller. From owner-svn-src-stable@FreeBSD.ORG Mon Jul 11 05:16:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50E491065670; Mon, 11 Jul 2011 05:16:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409DD8FC15; Mon, 11 Jul 2011 05:16: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 p6B5GDXU076672; Mon, 11 Jul 2011 05:16:13 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6B5GDdY076670; Mon, 11 Jul 2011 05:16:13 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201107110516.p6B5GDdY076670@svn.freebsd.org> From: Kirk McKusick Date: Mon, 11 Jul 2011 05:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223918 - stable/8/sys/ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2011 05:16:13 -0000 Author: mckusick Date: Mon Jul 11 05:16:12 2011 New Revision: 223918 URL: http://svn.freebsd.org/changeset/base/223918 Log: MFC r223902: When first creating snapshots, we may free some blocks within it. These blocks should not have TRIM applied to them. Submitted by: Kostik Belousov Modified: stable/8/sys/ufs/ffs/ffs_alloc.c Modified: stable/8/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_alloc.c Sun Jul 10 23:47:03 2011 (r223917) +++ stable/8/sys/ufs/ffs/ffs_alloc.c Mon Jul 11 05:16:12 2011 (r223918) @@ -2032,7 +2032,11 @@ ffs_blkfree(ump, fs, devvp, bno, size, i ffs_snapblkfree(fs, devvp, bno, size, inum)) { return; } - if (!ump->um_candelete) { + /* + * Nothing to delay if TRIM is disabled, or the operation is + * performed on the snapshot. + */ + if (!ump->um_candelete || devvp->v_type == VREG) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum); return; } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 01:16:44 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 218D8106566C; Tue, 12 Jul 2011 01:16:44 +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 119358FC08; Tue, 12 Jul 2011 01:16: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 p6C1GhG8016646; Tue, 12 Jul 2011 01:16:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6C1GhTN016644; Tue, 12 Jul 2011 01:16:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107120116.p6C1GhTN016644@svn.freebsd.org> From: Xin LI Date: Tue, 12 Jul 2011 01:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223941 - stable/8/contrib/libpcap/bpf/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 01:16:44 -0000 Author: delphij Date: Tue Jul 12 01:16:43 2011 New Revision: 223941 URL: http://svn.freebsd.org/changeset/base/223941 Log: MFC r223616: Incorporate vendor commit ecdc5c0a7f7591a7cd4a: In userland, sign extend the offset for JA instructions. We currently use that to implement "ip6 protochain", and "pc" might be wider than "pc->k", in which case we need to arrange that "pc->k" be sign-extended, by casting it to bpf_int32. PR: kern/157188 Submitted by: plosher Modified: stable/8/contrib/libpcap/bpf/net/bpf_filter.c Directory Properties: stable/8/contrib/libpcap/ (props changed) Modified: stable/8/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- stable/8/contrib/libpcap/bpf/net/bpf_filter.c Tue Jul 12 00:31:11 2011 (r223940) +++ stable/8/contrib/libpcap/bpf/net/bpf_filter.c Tue Jul 12 01:16:43 2011 (r223941) @@ -396,7 +396,18 @@ bpf_filter(pc, p, wirelen, buflen) continue; case BPF_JMP|BPF_JA: +#if defined(KERNEL) || defined(_KERNEL) + /* + * No backward jumps allowed. + */ pc += pc->k; +#else + /* + * XXX - we currently implement "ip6 protochain" + * with backward jumps, so sign-extend pc->k. + */ + pc += (bpf_int32)pc->k; +#endif continue; case BPF_JMP|BPF_JGT|BPF_K: From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 12:29:33 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410A9106564A; Tue, 12 Jul 2011 12:29:33 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30BAE8FC08; Tue, 12 Jul 2011 12:29: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 p6CCTX1O038853; Tue, 12 Jul 2011 12:29:33 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6CCTXsX038849; Tue, 12 Jul 2011 12:29:33 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201107121229.p6CCTXsX038849@svn.freebsd.org> From: Marko Zec Date: Tue, 12 Jul 2011 12:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223948 - in stable/8/sys: net netinet netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 12:29:33 -0000 Author: zec Date: Tue Jul 12 12:29:32 2011 New Revision: 223948 URL: http://svn.freebsd.org/changeset/base/223948 Log: MFC r223862: Permit ARP to proceed for IPv4 host routes for which the gateway is the same as the host address. This already works fine for INET6 and ND6. While here, remove two function pointers from struct lltable which are only initialized but never used. Modified: stable/8/sys/net/if_llatbl.h stable/8/sys/netinet/in.c stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_llatbl.h ============================================================================== --- stable/8/sys/net/if_llatbl.h Tue Jul 12 11:47:08 2011 (r223947) +++ stable/8/sys/net/if_llatbl.h Tue Jul 12 12:29:32 2011 (r223948) @@ -146,15 +146,12 @@ struct lltable { int llt_af; struct ifnet *llt_ifp; - struct llentry * (*llt_new)(const struct sockaddr *, u_int); void (*llt_free)(struct lltable *, struct llentry *); void (*llt_prefix_free)(struct lltable *, const struct sockaddr *prefix, const struct sockaddr *mask); struct llentry * (*llt_lookup)(struct lltable *, u_int flags, const struct sockaddr *l3addr); - int (*llt_rtcheck)(struct ifnet *, u_int flags, - const struct sockaddr *); int (*llt_dump)(struct lltable *, struct sysctl_req *); }; Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Jul 12 11:47:08 2011 (r223947) +++ stable/8/sys/netinet/in.c Tue Jul 12 12:29:32 2011 (r223948) @@ -1399,6 +1399,18 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ /* XXX rtalloc1 should take a const param */ rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); + + /* + * If the gateway for an existing host route matches the target L3 + * address, allow for ARP to proceed. + */ + if (rt != NULL && (rt->rt_flags & (RTF_HOST|RTF_GATEWAY)) && + rt->rt_gateway->sa_family == AF_INET && + memcmp(rt->rt_gateway->sa_data, l3addr->sa_data, 4) == 0) { + RTFREE_LOCKED(rt); + return (0); + } + if (rt == NULL || (!(flags & LLE_PUB) && ((rt->rt_flags & RTF_GATEWAY) || (rt->rt_ifp != ifp)))) { @@ -1581,10 +1593,8 @@ in_domifattach(struct ifnet *ifp) llt = lltable_init(ifp, AF_INET); if (llt != NULL) { - llt->llt_new = in_lltable_new; llt->llt_free = in_lltable_free; llt->llt_prefix_free = in_lltable_prefix_free; - llt->llt_rtcheck = in_lltable_rtcheck; llt->llt_lookup = in_lltable_lookup; llt->llt_dump = in_lltable_dump; } Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Tue Jul 12 11:47:08 2011 (r223947) +++ stable/8/sys/netinet6/in6.c Tue Jul 12 12:29:32 2011 (r223948) @@ -2581,10 +2581,8 @@ in6_domifattach(struct ifnet *ifp) ext->scope6_id = scope6_ifattach(ifp); ext->lltable = lltable_init(ifp, AF_INET6); if (ext->lltable != NULL) { - ext->lltable->llt_new = in6_lltable_new; ext->lltable->llt_free = in6_lltable_free; ext->lltable->llt_prefix_free = in6_lltable_prefix_free; - ext->lltable->llt_rtcheck = in6_lltable_rtcheck; ext->lltable->llt_lookup = in6_lltable_lookup; ext->lltable->llt_dump = in6_lltable_dump; } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 13:16:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D881065672; Tue, 12 Jul 2011 13:16:47 +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 23EC88FC0C; Tue, 12 Jul 2011 13:16: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 p6CDGlMe040322; Tue, 12 Jul 2011 13:16:47 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6CDGkT2040316; Tue, 12 Jul 2011 13:16:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107121316.p6CDGkT2040316@svn.freebsd.org> From: Martin Matuska Date: Tue, 12 Jul 2011 13:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223950 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 13:16:47 -0000 Author: mm Date: Tue Jul 12 13:16:46 2011 New Revision: 223950 URL: http://svn.freebsd.org/changeset/base/223950 Log: MFC r223623: Add a new "REFCOMPRESSRATIO" property. For snapshots, this is the same as COMPRESSRATIO, but for filesystems/volumes, the COMPRESSRATIO is based on the data "USED" (ie, includes blocks in children, but not blocks shared with the origin). This is needed to figure out how much space a filesystem would use if it were not compressed (ignoring snapshots). Illumos-gate revision: 13387 Obtained from: Illumos (Feature #1092) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jul 12 13:06:44 2011 (r223949) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue Jul 12 13:16:46 2011 (r223950) @@ -6,6 +6,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.\" Copyright 2011 by Delphix. All rights reserved. .TH zfs 1M "24 Sep 2009" "SunOS 5.11" "System Administration Commands" .SH NAME zfs \- configures ZFS file systems @@ -389,7 +390,7 @@ This property can also be referred to by .ad .sp .6 .RS 4n -The compression ratio achieved for this dataset, expressed as a multiplier. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR. +For non-snapshots, the compression ratio achieved for the \fBused\fR space of this dataset, expressed as a multiplier. The \fBused\fR property includes descendant datasets, and, for clones, does not include the space shared with the origin snapshot. For snapshots, the \fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR. .RE .sp @@ -453,6 +454,17 @@ This property can also be referred to by .ne 2 .mk .na +\fB\fBrefcompressratio\fR\fR +.ad +.sp .6 +.RS 4n +The compression ratio achieved for the \fBreferenced\fR space of this dataset, expressed as a multiplier. See also the \fBcompressratio\fR property. +.RE + +.sp +.ne 2 +.mk +.na \fB\fBtype\fR\fR .ad .sp .6 @@ -1278,7 +1290,7 @@ Recursively destroy all dependents, incl Force an unmount of any file systems using the \fBunmount -f\fR command. This option has no effect on non-file systems or unmounted file systems. .RE -Extreme care should be taken when applying either the \fB-r\fR or the \fB-f\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use. +Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use. .RE .sp Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Jul 12 13:06:44 2011 (r223949) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Jul 12 13:16:46 2011 (r223950) @@ -22,6 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -2038,6 +2039,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } break; + case ZFS_PROP_REFRATIO: case ZFS_PROP_COMPRESSRATIO: if (get_numeric_property(zhp, prop, src, &source, &val) != 0) return (-1); Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jul 12 13:06:44 2011 (r223949) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Jul 12 13:16:46 2011 (r223950) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -311,6 +312,9 @@ zfs_prop_init(void) zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0, PROP_READONLY, ZFS_TYPE_DATASET, "<1.00x or higher if compressed>", "RATIO"); + zprop_register_number(ZFS_PROP_REFRATIO, "refcompressratio", 0, + PROP_READONLY, ZFS_TYPE_DATASET, + "<1.00x or higher if compressed>", "REFRATIO"); zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize", ZVOL_DEFAULT_BLOCKSIZE, PROP_ONETIME, ZFS_TYPE_VOLUME, "512 to 128k, power of 2", "VOLBLOCK"); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jul 12 13:06:44 2011 (r223949) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Jul 12 13:16:46 2011 (r223950) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -2150,7 +2151,7 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ void dsl_dataset_stats(dsl_dataset_t *ds, nvlist_t *nv) { - uint64_t refd, avail, uobjs, aobjs; + uint64_t refd, avail, uobjs, aobjs, ratio; dsl_dir_stats(ds->ds_dir, nv); @@ -2177,6 +2178,11 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_DEFER_DESTROY, DS_IS_DEFER_DESTROY(ds) ? 1 : 0); + ratio = ds->ds_phys->ds_compressed_bytes == 0 ? 100 : + (ds->ds_phys->ds_uncompressed_bytes * 100 / + ds->ds_phys->ds_compressed_bytes); + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_REFRATIO, ratio); + if (ds->ds_phys->ds_next_snap_obj) { /* * This is a snapshot; override the dd's space used with @@ -2184,10 +2190,7 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl */ dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_USED, ds->ds_phys->ds_unique_bytes); - dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, - ds->ds_phys->ds_compressed_bytes == 0 ? 100 : - (ds->ds_phys->ds_uncompressed_bytes * 100 / - ds->ds_phys->ds_compressed_bytes)); + dsl_prop_nvlist_add_uint64(nv, ZFS_PROP_COMPRESSRATIO, ratio); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 12 13:06:44 2011 (r223949) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Jul 12 13:16:46 2011 (r223950) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -124,6 +125,7 @@ typedef enum { ZFS_PROP_DEDUP, ZFS_PROP_MLSLABEL, ZFS_PROP_SYNC, + ZFS_PROP_REFRATIO, ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 14:28:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A6FD1065674; Tue, 12 Jul 2011 14:28:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC888FC20; Tue, 12 Jul 2011 14:28: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 p6CESDNB042699; Tue, 12 Jul 2011 14:28:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6CESDOF042697; Tue, 12 Jul 2011 14:28:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107121428.p6CESDOF042697@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Jul 2011 14:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223956 - stable/7/usr.bin/top X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 14:28:14 -0000 Author: jhb Date: Tue Jul 12 14:28:13 2011 New Revision: 223956 URL: http://svn.freebsd.org/changeset/base/223956 Log: MFC 182966: Display the sum of the runtime of all the threads in a process when it's multithreaded instead of picking the time of the first thread found. Modified: stable/7/usr.bin/top/machine.c Directory Properties: stable/7/usr.bin/top/ (props changed) Modified: stable/7/usr.bin/top/machine.c ============================================================================== --- stable/7/usr.bin/top/machine.c Tue Jul 12 14:18:54 2011 (r223955) +++ stable/7/usr.bin/top/machine.c Tue Jul 12 14:28:13 2011 (r223956) @@ -726,6 +726,7 @@ get_process_info(struct system_info *si, prev_pp = pp; } else { prev_pp->ki_pctcpu += pp->ki_pctcpu; + prev_pp->ki_runtime += pp->ki_runtime; } } From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 21:01:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD3A1065672; Tue, 12 Jul 2011 21:01:10 +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 29C388FC08; Tue, 12 Jul 2011 21:01:10 +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 p6CL1A8m055279; Tue, 12 Jul 2011 21:01:10 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6CL1AW4055275; Tue, 12 Jul 2011 21:01:10 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201107122101.p6CL1AW4055275@svn.freebsd.org> From: Rick Macklem Date: Tue, 12 Jul 2011 21:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223968 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 21:01:10 -0000 Author: rmacklem Date: Tue Jul 12 21:01:09 2011 New Revision: 223968 URL: http://svn.freebsd.org/changeset/base/223968 Log: MFC: r223657 Fix the new NFSv4 client so that it doesn't fill the cached mode attribute in as 0 when doing writes. The change adds the Mode attribute plus the others except Owner and Owner_group to the list requested by the NFSv4 Write Operation. This fixed a problem where an executable file built by "cc" would get mode 0111 instead of 0755 for some NFSv4 servers. Found at the recent NFSv4 interoperability Bakeathon. Modified: stable/8/sys/fs/nfs/nfsproto.h stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/8/sys/fs/nfs/nfsproto.h Tue Jul 12 20:38:42 2011 (r223967) +++ stable/8/sys/fs/nfs/nfsproto.h Tue Jul 12 21:01:09 2011 (r223968) @@ -826,15 +826,24 @@ struct nfsv3_sattr { * NFSATTRBIT_WRITEGETATTR0 - bits 0<->31 */ #define NFSATTRBIT_WRITEGETATTR0 \ - (NFSATTRBM_CHANGE | \ + (NFSATTRBM_SUPPORTEDATTRS | \ + NFSATTRBM_TYPE | \ + NFSATTRBM_CHANGE | \ NFSATTRBM_SIZE | \ - NFSATTRBM_FSID) + NFSATTRBM_FSID | \ + NFSATTRBM_FILEID | \ + NFSATTRBM_MAXREAD) /* * NFSATTRBIT_WRITEGETATTR1 - bits 32<->63 */ #define NFSATTRBIT_WRITEGETATTR1 \ - (NFSATTRBM_TIMEMETADATA | \ + (NFSATTRBM_MODE | \ + NFSATTRBM_NUMLINKS | \ + NFSATTRBM_RAWDEV | \ + NFSATTRBM_SPACEUSED | \ + NFSATTRBM_TIMEACCESS | \ + NFSATTRBM_TIMEMETADATA | \ NFSATTRBM_TIMEMODIFY) /* Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Tue Jul 12 20:38:42 2011 (r223967) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Tue Jul 12 21:01:09 2011 (r223968) @@ -366,6 +366,7 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_vattr.na_mtime = nap->na_mtime; np->n_vattr.na_ctime = nap->na_ctime; np->n_vattr.na_fsid = nap->na_fsid; + np->n_vattr.na_mode = nap->na_mode; } else { NFSBCOPY((caddr_t)nap, (caddr_t)&np->n_vattr, sizeof (struct nfsvattr)); Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Tue Jul 12 20:38:42 2011 (r223967) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Tue Jul 12 21:01:09 2011 (r223968) @@ -1527,8 +1527,8 @@ nfsrpc_writerpc(vnode_t vp, struct uio * * deadlock, is that the upcall times out and allows * the write to complete. However, progress is so slow * that it might just as well be deadlocked. - * So, we just get the attributes that change with each - * write Op. + * As such, we get the rest of the attributes, but not + * Owner or Owner_group. * nb: nfscl_loadattrcache() needs to be told that these * partial attributes from a write rpc are being * passed in, via a argument flag. From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 23:39:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2F70106564A; Tue, 12 Jul 2011 23:39:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D358E8FC0C; Tue, 12 Jul 2011 23:39:56 +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 p6CNdupd059949; Tue, 12 Jul 2011 23:39:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6CNduKQ059947; Tue, 12 Jul 2011 23:39:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201107122339.p6CNduKQ059947@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 12 Jul 2011 23:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223969 - stable/8/usr.bin/wall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 23:39:57 -0000 Author: obrien Date: Tue Jul 12 23:39:56 2011 New Revision: 223969 URL: http://svn.freebsd.org/changeset/base/223969 Log: MFC: r223940: If one's message is longer than the buffer size, then we reset 'cnt' at the wrong point and the actual column # get out of sync across the buffer size. Modified: stable/8/usr.bin/wall/wall.c Directory Properties: stable/8/usr.bin/wall/ (props changed) Modified: stable/8/usr.bin/wall/wall.c ============================================================================== --- stable/8/usr.bin/wall/wall.c Tue Jul 12 21:01:09 2011 (r223968) +++ stable/8/usr.bin/wall/wall.c Tue Jul 12 23:39:56 2011 (r223969) @@ -251,8 +251,9 @@ makemsg(char *fname) err(1, "can't read %s", fname); setegid(egid); } + cnt = 0; while (fgets(lbuf, sizeof(lbuf), stdin)) { - for (cnt = 0, p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { + for (p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { if (ch == '\r') { putc('\r', fp); cnt = 0; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 12 23:48:58 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D7641065676; Tue, 12 Jul 2011 23:48:58 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DC408FC0A; Tue, 12 Jul 2011 23:48: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 p6CNmwU9060348; Tue, 12 Jul 2011 23:48:58 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6CNmwpZ060346; Tue, 12 Jul 2011 23:48:58 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201107122348.p6CNmwpZ060346@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 12 Jul 2011 23:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223970 - stable/7/usr.bin/wall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 23:48:58 -0000 Author: obrien Date: Tue Jul 12 23:48:57 2011 New Revision: 223970 URL: http://svn.freebsd.org/changeset/base/223970 Log: MFC: + r223940 (as r223969): If one's message is longer than the buffer size, then we reset 'cnt' at the wrong point and the actual column # get out of sync across the buffer size. + r175346: Handle wrapping correctly when \r appears in the input, and don't remove the \r from the output. For lines longer than 79 characters, don't drop every 80th character. Modified: stable/7/usr.bin/wall/wall.c Directory Properties: stable/7/usr.bin/wall/ (props changed) Modified: stable/7/usr.bin/wall/wall.c ============================================================================== --- stable/7/usr.bin/wall/wall.c Tue Jul 12 23:39:56 2011 (r223969) +++ stable/7/usr.bin/wall/wall.c Tue Jul 12 23:48:57 2011 (r223970) @@ -251,17 +251,26 @@ makemsg(char *fname) err(1, "can't read %s", fname); setegid(egid); } - while (fgets(lbuf, sizeof(lbuf), stdin)) - for (cnt = 0, p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { + cnt = 0; + while (fgets(lbuf, sizeof(lbuf), stdin)) { + for (p = lbuf; (ch = *p) != '\0'; ++p, ++cnt) { if (ch == '\r') { + putc('\r', fp); cnt = 0; - } else if (cnt == 79 || ch == '\n') { + continue; + } else if (ch == '\n') { for (; cnt < 79; ++cnt) putc(' ', fp); putc('\r', fp); putc('\n', fp); + break; + } + if (cnt == 79) { + putc('\r', fp); + putc('\n', fp); cnt = 0; - } else if (((ch & 0x80) && ch < 0xA0) || + } + if (((ch & 0x80) && ch < 0xA0) || /* disable upper controls */ (!isprint(ch) && !isspace(ch) && ch != '\a' && ch != '\b') @@ -290,11 +299,10 @@ makemsg(char *fname) cnt = 0; } } - putc(ch, fp); - } else { - putc(ch, fp); } + putc(ch, fp); } + } (void)fprintf(fp, "%79s\r\n", " "); rewind(fp); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 04:27:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6776106564A; Wed, 13 Jul 2011 04:27:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A58008FC08; Wed, 13 Jul 2011 04:27: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 p6D4RlAU068864; Wed, 13 Jul 2011 04:27:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6D4RlbS068862; Wed, 13 Jul 2011 04:27:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107130427.p6D4RlbS068862@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 13 Jul 2011 04:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223972 - stable/8/sbin/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 04:27:47 -0000 Author: ae Date: Wed Jul 13 04:27:47 2011 New Revision: 223972 URL: http://svn.freebsd.org/changeset/base/223972 Log: MFC r223661: Improve error reporting. Use corresponding error message when file to be preprocessed is missing. Also suggest to use absolute pathname if -p option is specified. PR: bin/156653 Modified: stable/8/sbin/ipfw/main.c Directory Properties: stable/8/sbin/ipfw/ (props changed) Modified: stable/8/sbin/ipfw/main.c ============================================================================== --- stable/8/sbin/ipfw/main.c Wed Jul 13 00:48:36 2011 (r223971) +++ stable/8/sbin/ipfw/main.c Wed Jul 13 04:27:47 2011 (r223972) @@ -262,7 +262,7 @@ ipfw_main(int oldac, char **oldav) save_av = av; optind = optreset = 1; /* restart getopt() */ - while ((ch = getopt(ac, av, "abcdefhinNqs:STtv")) != -1) + while ((ch = getopt(ac, av, "abcdefhinNp:qs:STtv")) != -1) switch (ch) { case 'a': do_acct = 1; @@ -306,6 +306,10 @@ ipfw_main(int oldac, char **oldav) co.do_resolv = 1; break; + case 'p': + errx(EX_USAGE, "An absolute pathname must be used " + "with -p option."); + case 'q': co.do_quiet = 1; break; @@ -603,9 +607,12 @@ main(int ac, char *av[]) * as a file to be preprocessed. */ - if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0) - ipfw_readfile(ac, av); - else { + if (ac > 1 && av[ac - 1][0] == '/') { + if (access(av[ac - 1], R_OK) == 0) + ipfw_readfile(ac, av); + else + err(EX_USAGE, "pathname: %s", av[ac - 1]); + } else { if (ipfw_main(ac, av)) { errx(EX_USAGE, "usage: ipfw [options]\n" From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 04:30:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 693D6106564A; Wed, 13 Jul 2011 04:30:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5890C8FC2B; Wed, 13 Jul 2011 04:30: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 p6D4UGb0068984; Wed, 13 Jul 2011 04:30:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6D4UGoX068982; Wed, 13 Jul 2011 04:30:16 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107130430.p6D4UGoX068982@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 13 Jul 2011 04:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223973 - stable/7/sbin/ipfw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 04:30:16 -0000 Author: ae Date: Wed Jul 13 04:30:16 2011 New Revision: 223973 URL: http://svn.freebsd.org/changeset/base/223973 Log: MFC r223661: Improve error reporting. Use corresponding error message when file to be preprocessed is missing. Also suggest to use absolute pathname if -p option is specified. PR: bin/156653 Modified: stable/7/sbin/ipfw/main.c Directory Properties: stable/7/sbin/ipfw/ (props changed) Modified: stable/7/sbin/ipfw/main.c ============================================================================== --- stable/7/sbin/ipfw/main.c Wed Jul 13 04:27:47 2011 (r223972) +++ stable/7/sbin/ipfw/main.c Wed Jul 13 04:30:16 2011 (r223973) @@ -204,7 +204,7 @@ ipfw_main(int oldac, char **oldav) save_av = av; optind = optreset = 1; /* restart getopt() */ - while ((ch = getopt(ac, av, "abcdefhinNqs:STtv")) != -1) + while ((ch = getopt(ac, av, "abcdefhinNp:qs:STtv")) != -1) switch (ch) { case 'a': do_acct = 1; @@ -248,6 +248,10 @@ ipfw_main(int oldac, char **oldav) co.do_resolv = 1; break; + case 'p': + errx(EX_USAGE, "An absolute pathname must be used " + "with -p option."); + case 'q': co.do_quiet = 1; break; @@ -527,9 +531,12 @@ main(int ac, char *av[]) * as a file to be preprocessed. */ - if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0) - ipfw_readfile(ac, av); - else { + if (ac > 1 && av[ac - 1][0] == '/') { + if (access(av[ac - 1], R_OK) == 0) + ipfw_readfile(ac, av); + else + err(EX_USAGE, "pathname: %s", av[ac - 1]); + } else { if (ipfw_main(ac, av)) { errx(EX_USAGE, "usage: ipfw [options]\n" From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 05:42:05 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E089B106564A; Wed, 13 Jul 2011 05:42:04 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 970408FC08; Wed, 13 Jul 2011 05:42: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 p6D5g4bO071211; Wed, 13 Jul 2011 05:42:04 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6D5g4qh071207; Wed, 13 Jul 2011 05:42:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201107130542.p6D5g4qh071207@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 13 Jul 2011 05:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223975 - stable/8/sbin/hastd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 05:42:05 -0000 Author: trociny Date: Wed Jul 13 05:42:04 2011 New Revision: 223975 URL: http://svn.freebsd.org/changeset/base/223975 Log: MFC r223654, r223655, r223780, 223974: r223654: Make activemap_write_start/complete check the keepdirty list, when stating if we need to update activemap on disk. This makes keepdirty serve its purpose -- to reduce number of metadata updates. Discussed with: pjd r223655, 223974: Check the returned value of activemap_write_complete() and update matadata on disk if needed. This should fix a potential case when extents are cleared in activemap but metadata is not updated on disk. Suggested by: pjd r223780: Remove useless initialization. Approved by: pjd (mentor) Modified: stable/8/sbin/hastd/activemap.c stable/8/sbin/hastd/control.c stable/8/sbin/hastd/primary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/activemap.c ============================================================================== --- stable/8/sbin/hastd/activemap.c Wed Jul 13 05:32:55 2011 (r223974) +++ stable/8/sbin/hastd/activemap.c Wed Jul 13 05:42:04 2011 (r223975) @@ -205,7 +205,7 @@ keepdirty_find(struct activemap *amp, in return (kd); } -static void +static bool keepdirty_add(struct activemap *amp, int extent) { struct keepdirty *kd; @@ -217,7 +217,7 @@ keepdirty_add(struct activemap *amp, int */ TAILQ_REMOVE(&->am_keepdirty, kd, kd_next); TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); - return; + return (false); } /* * Add new element, but first remove the most unused one if @@ -238,6 +238,8 @@ keepdirty_add(struct activemap *amp, int amp->am_nkeepdirty++; TAILQ_INSERT_HEAD(&->am_keepdirty, kd, kd_next); } + + return (true); } static void @@ -308,9 +310,9 @@ activemap_write_start(struct activemap * assert(!bit_test(amp->am_memmap, ext)); bit_set(amp->am_memmap, ext); amp->am_ndirty++; - modified = true; } - keepdirty_add(amp, ext); + if (keepdirty_add(amp, ext)) + modified = true; } return (modified); @@ -345,7 +347,8 @@ activemap_write_complete(struct activema if (--amp->am_memtab[ext] == 0) { bit_clear(amp->am_memmap, ext); amp->am_ndirty--; - modified = true; + if (keepdirty_find(amp, ext) == NULL) + modified = true; } } Modified: stable/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Wed Jul 13 05:32:55 2011 (r223974) +++ stable/8/sbin/hastd/control.c Wed Jul 13 05:42:04 2011 (r223975) @@ -155,8 +155,7 @@ control_status_worker(struct hast_resour const char *str; int error; - cnvin = cnvout = NULL; - error = 0; + cnvin = NULL; /* * Prepare and send command to worker process. Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Wed Jul 13 05:32:55 2011 (r223974) +++ stable/8/sbin/hastd/primary.c Wed Jul 13 05:42:04 2011 (r223975) @@ -1687,8 +1687,11 @@ ggate_send_thread(void *arg) } if (ggio->gctl_error == 0 && ggio->gctl_cmd == BIO_WRITE) { mtx_lock(&res->hr_amp_lock); - activemap_write_complete(res->hr_amp, - ggio->gctl_offset, ggio->gctl_length); + if (activemap_write_complete(res->hr_amp, + ggio->gctl_offset, ggio->gctl_length)) { + res->hr_stat_activemap_update++; + (void)hast_activemap_flush(res); + } mtx_unlock(&res->hr_amp_lock); } if (ggio->gctl_cmd == BIO_WRITE) { From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 06:20:01 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A0E106566B; Wed, 13 Jul 2011 06:20:01 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF1A8FC15; Wed, 13 Jul 2011 06:20:01 +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 p6D6K1aN072368; Wed, 13 Jul 2011 06:20:01 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6D6K1qL072366; Wed, 13 Jul 2011 06:20:01 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107130620.p6D6K1qL072366@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 13 Jul 2011 06:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223977 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 06:20:01 -0000 Author: jh Date: Wed Jul 13 06:20:00 2011 New Revision: 223977 URL: http://svn.freebsd.org/changeset/base/223977 Log: MFC r222216: In init_dynamic_kenv(), ignore environment strings exceeding the KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer overflow in getenv(). Currenly loader(8) doesn't limit the length of environment strings. PR: kern/132104 Modified: stable/8/sys/kern/kern_environment.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_environment.c ============================================================================== --- stable/8/sys/kern/kern_environment.c Wed Jul 13 05:56:51 2011 (r223976) +++ stable/8/sys/kern/kern_environment.c Wed Jul 13 06:20:00 2011 (r223977) @@ -215,13 +215,19 @@ static void init_dynamic_kenv(void *data __unused) { char *cp; - int len, i; + size_t len; + int i; kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; + if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + printf("WARNING: too long kenv string, ignoring %s\n", + cp); + continue; + } if (i < KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 12:50:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB0E1065672; Wed, 13 Jul 2011 12:50:23 +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 5F6D28FC14; Wed, 13 Jul 2011 12:50: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 p6DCoNHR085087; Wed, 13 Jul 2011 12:50:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6DCoN91085085; Wed, 13 Jul 2011 12:50:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107131250.p6DCoN91085085@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 13 Jul 2011 12:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223978 - stable/8/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 12:50:23 -0000 Author: kib Date: Wed Jul 13 12:50:23 2011 New Revision: 223978 URL: http://svn.freebsd.org/changeset/base/223978 Log: MFC r223911: Update locking annotations for the struct vnode. Modified: stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Wed Jul 13 06:20:00 2011 (r223977) +++ stable/8/sys/sys/vnode.h Wed Jul 13 12:50:23 2011 (r223978) @@ -75,12 +75,9 @@ struct vpollinfo { * Lock reference: * c - namecache mutex * f - freelist mutex - * G - Giant * i - interlock - * m - mntvnodes mutex + * m - mount point interlock * p - pollinfo lock - * s - spechash mutex - * S - syncer mutex * u - Only a reference to the vnode is needed to read. * v - vnode lock * @@ -166,7 +163,7 @@ struct vnode { /* * Hooks for various subsystems and features. */ - struct vpollinfo *v_pollinfo; /* G Poll events, p for *v_pi */ + struct vpollinfo *v_pollinfo; /* i Poll events, p for *v_pi */ struct label *v_label; /* MAC label for vnode */ struct lockf *v_lockf; /* Byte-level lock list */ }; From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 12:53:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDEC106566B; Wed, 13 Jul 2011 12:53:53 +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 2DD338FC12; Wed, 13 Jul 2011 12:53: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 p6DCrriO085229; Wed, 13 Jul 2011 12:53:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6DCrr7g085227; Wed, 13 Jul 2011 12:53:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107131253.p6DCrr7g085227@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 13 Jul 2011 12:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223979 - stable/8/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 12:53:53 -0000 Author: kib Date: Wed Jul 13 12:53:52 2011 New Revision: 223979 URL: http://svn.freebsd.org/changeset/base/223979 Log: MFC r223913: Style. Modified: stable/8/sys/vm/vm_mmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Wed Jul 13 12:50:23 2011 (r223978) +++ stable/8/sys/vm/vm_mmap.c Wed Jul 13 12:53:52 2011 (r223979) @@ -1329,7 +1329,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, if (td->td_proc->p_vmspace->vm_map.size + size > lim_cur(td->td_proc, RLIMIT_VMEM)) { PROC_UNLOCK(td->td_proc); - return(ENOMEM); + return (ENOMEM); } PROC_UNLOCK(td->td_proc); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 13 17:09:16 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB5F4106566C; Wed, 13 Jul 2011 17:09:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA2528FC0A; Wed, 13 Jul 2011 17:09:15 +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 p6DH9F9c092762; Wed, 13 Jul 2011 17:09:15 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6DH9Fo6092758; Wed, 13 Jul 2011 17:09:15 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201107131709.p6DH9Fo6092758@svn.freebsd.org> From: Sean Bruno Date: Wed, 13 Jul 2011 17:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223982 - in stable/7: sbin/umount sys/nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 17:09:16 -0000 Author: sbruno Date: Wed Jul 13 17:09:15 2011 New Revision: 223982 URL: http://svn.freebsd.org/changeset/base/223982 Log: MFC r222541, r222464, r222466 Modify the umount(8) command so that it doesn't do a sync(2) syscall before unmount(2) for the "-f" case. This avoids a forced dismount from getting stuck for an NFS mountpoint in sync() when the server is not responsive. With this commit, forced dismounts should normally work for the NFS clients, but can take up to about 1minute to complete. Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync() in the old NFS client so that a forced dismount doesn't get stuck in the VFS_SYNC() call that happens before VFS_UNMOUNT() in dounmount(). Analagous to r222329 for the new NFS client. An additional change is needed before forced dismounts will work. Add a sentence to the umount.8 man page to clarify the behaviour for forced dismount when used on an NFS mount point. Requested by Jeremy Chadwick. This is a content change Modified: stable/7/sbin/umount/umount.8 stable/7/sbin/umount/umount.c stable/7/sys/nfsclient/nfs_vfsops.c Modified: stable/7/sbin/umount/umount.8 ============================================================================== --- stable/7/sbin/umount/umount.8 Wed Jul 13 14:10:28 2011 (r223981) +++ stable/7/sbin/umount/umount.8 Wed Jul 13 17:09:15 2011 (r223982) @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd July 18, 2003 +.Dd May 31, 2011 .Dt UMOUNT 8 .Os .Sh NAME @@ -77,6 +77,9 @@ The file system is forcibly unmounted. Active special devices continue to work, but all other files return errors if further accesses are attempted. The root file system cannot be forcibly unmounted. +For NFS, a forced dismount can take up to 1 minute or more to +complete against an unresponsive server and may throw away +data not yet written to the server for this case. .It Fl h Ar host Only file systems mounted from the specified host will be unmounted. Modified: stable/7/sbin/umount/umount.c ============================================================================== --- stable/7/sbin/umount/umount.c Wed Jul 13 14:10:28 2011 (r223981) +++ stable/7/sbin/umount/umount.c Wed Jul 13 17:09:15 2011 (r223982) @@ -90,9 +90,6 @@ main(int argc, char *argv[]) struct statfs *mntbuf, *sfs; struct addrinfo hints; - /* Start disks transferring immediately. */ - sync(); - all = errs = 0; while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1) switch (ch) { @@ -127,6 +124,9 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + /* Start disks transferring immediately. */ + if ((fflag & MNT_FORCE) == 0) + sync(); if ((argc == 0 && !all) || (argc != 0 && all)) usage(); Modified: stable/7/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vfsops.c Wed Jul 13 14:10:28 2011 (r223981) +++ stable/7/sys/nfsclient/nfs_vfsops.c Wed Jul 13 17:09:15 2011 (r223982) @@ -1297,10 +1297,19 @@ nfs_sync(struct mount *mp, int waitfor, struct vnode *vp, *mvp; int error, allerror = 0; + MNT_ILOCK(mp); + /* + * If a forced dismount is in progress, return from here so that + * the umount(2) syscall doesn't get stuck in VFS_SYNC() before + * calling VFS_UNMOUNT(). + */ + if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + MNT_IUNLOCK(mp); + return (EBADF); + } /* * Force stale buffer cache information to be flushed. */ - MNT_ILOCK(mp); loop: MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 04:21:27 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90FD9106564A; Thu, 14 Jul 2011 04:21:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80D9B8FC0A; Thu, 14 Jul 2011 04:21:27 +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 p6E4LRGx013048; Thu, 14 Jul 2011 04:21:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6E4LRxr013046; Thu, 14 Jul 2011 04:21:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201107140421.p6E4LRxr013046@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 14 Jul 2011 04:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223995 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 04:21:27 -0000 Author: ae Date: Thu Jul 14 04:21:27 2011 New Revision: 223995 URL: http://svn.freebsd.org/changeset/base/223995 Log: MFC r223840: Add again the checking for log_arp_permanent_modify that was by accident removed in the r186119. PR: kern/154831 Modified: stable/8/sys/netinet/if_ether.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Thu Jul 14 03:16:43 2011 (r223994) +++ stable/8/sys/netinet/if_ether.c Thu Jul 14 04:21:27 2011 (r223995) @@ -680,11 +680,13 @@ match: bcmp(ar_sha(ah), &la->ll_addr, ifp->if_addrlen)) { if (la->la_flags & LLE_STATIC) { LLE_WUNLOCK(la); - log(LOG_ERR, - "arp: %*D attempts to modify permanent " - "entry for %s on %s\n", - ifp->if_addrlen, (u_char *)ar_sha(ah), ":", - inet_ntoa(isaddr), ifp->if_xname); + if (log_arp_permanent_modify) + log(LOG_ERR, + "arp: %*D attempts to modify " + "permanent entry for %s on %s\n", + ifp->if_addrlen, + (u_char *)ar_sha(ah), ":", + inet_ntoa(isaddr), ifp->if_xname); goto reply; } if (log_arp_movements) { From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 14:23:49 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 146041065670; Thu, 14 Jul 2011 14:23:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0152B8FC0C; Thu, 14 Jul 2011 14:23:49 +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 p6EENmlB033189; Thu, 14 Jul 2011 14:23:48 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EENmAo033180; Thu, 14 Jul 2011 14:23:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107141423.p6EENmAo033180@svn.freebsd.org> From: Martin Matuska Date: Thu, 14 Jul 2011 14:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224017 - in stable/8: contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/include/opcode contrib/binutils/opcodes sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 14:23:49 -0000 Author: mm Date: Thu Jul 14 14:23:48 2011 New Revision: 224017 URL: http://svn.freebsd.org/changeset/base/224017 Log: Backport SSSE3 instruction set support to base binutils and update VIA PadLock instruction set support. This has turned out to be necessary for some cases to catch up with gcc update in r221274 (MFC of r219639). This is direct commit to stable/8 Obtained from: GNU binutils CVS (GPLv2) Modified: stable/8/contrib/binutils/gas/ChangeLog stable/8/contrib/binutils/gas/config/tc-i386.c stable/8/contrib/binutils/gas/config/tc-i386.h stable/8/contrib/binutils/include/opcode/ChangeLog stable/8/contrib/binutils/include/opcode/i386.h stable/8/contrib/binutils/opcodes/ChangeLog stable/8/contrib/binutils/opcodes/i386-dis.c stable/8/sys/sys/param.h Modified: stable/8/contrib/binutils/gas/ChangeLog ============================================================================== --- stable/8/contrib/binutils/gas/ChangeLog Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/gas/ChangeLog Thu Jul 14 14:23:48 2011 (r224017) @@ -1,3 +1,23 @@ +2006-09-28 H.J. Lu + + * config/tc-i386.h (CpuMNI): Renamed to ... + (CpuSSSE3): This. + (CpuUnknownFlags): Updated. + * config/tc-i386.c: Updated. + +2006-02-27 H.J. Lu + + * gas/config/tc-i386.c (output_insn): Support Intel Merom New + Instructions. + + * gas/config/tc-i386.h (CpuMNI): New. + (CpuUnknownFlags): Add CpuMNI. + +2005-04-12 Mark Kettenis + + * config/tc-i386.c (output_insn): Handle VIA PadLock instructions + similar to other instructions now that they're marked as ImmExt. + 2004-05-23 Alan Modra * expr.c (operand, operator): Don't reject '++' and '--'. Modified: stable/8/contrib/binutils/gas/config/tc-i386.c ============================================================================== --- stable/8/contrib/binutils/gas/config/tc-i386.c Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/gas/config/tc-i386.c Thu Jul 14 14:23:48 2011 (r224017) @@ -3150,24 +3150,33 @@ output_insn () /* Output normal instructions here. */ char *p; unsigned char *q; + unsigned int prefix; - /* All opcodes on i386 have either 1 or 2 bytes, PadLock instructions - have 3 bytes. We may use one more higher byte to specify a prefix - the instruction requires. */ - if ((i.tm.cpu_flags & CpuPadLock) != 0 - && (i.tm.base_opcode & 0xff000000) != 0) - { - unsigned int prefix; - prefix = (i.tm.base_opcode >> 24) & 0xff; - - if (prefix != REPE_PREFIX_OPCODE - || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE) + /* All opcodes on i386 have either 1 or 2 bytes. Supplemental + Streaming SIMD extensions 3 Instructions have 3 bytes. We may + use one more higher byte to specify a prefix the instruction + requires. */ + if ((i.tm.cpu_flags & CpuSSSE3) != 0) + { + if (i.tm.base_opcode & 0xff000000) + { + prefix = (i.tm.base_opcode >> 24) & 0xff; + goto check_prefix; + } + } + else if ((i.tm.base_opcode & 0xff0000) != 0) + { + prefix = (i.tm.base_opcode >> 16) & 0xff; + if ((i.tm.cpu_flags & CpuPadLock) != 0) + { +check_prefix: + if (prefix != REPE_PREFIX_OPCODE + || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE) + add_prefix (prefix); + } + else add_prefix (prefix); } - else - if ((i.tm.cpu_flags & CpuPadLock) == 0 - && (i.tm.base_opcode & 0xff0000) != 0) - add_prefix ((i.tm.base_opcode >> 16) & 0xff); /* The prefix bytes. */ for (q = i.prefix; @@ -3188,7 +3197,7 @@ output_insn () } else { - if ((i.tm.cpu_flags & CpuPadLock) != 0) + if ((i.tm.cpu_flags & CpuSSSE3) != 0) { p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; Modified: stable/8/contrib/binutils/gas/config/tc-i386.h ============================================================================== --- stable/8/contrib/binutils/gas/config/tc-i386.h Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/gas/config/tc-i386.h Thu Jul 14 14:23:48 2011 (r224017) @@ -195,13 +195,14 @@ typedef struct #define Cpu3dnow 0x4000 /* 3dnow! support required */ #define CpuPNI 0x8000 /* Prescott New Instructions required */ #define CpuPadLock 0x10000 /* VIA PadLock required */ +#define CpuSSSE3 0x80000 /* Supplemental Streaming SIMD extensions 3 required */ /* These flags are set by gas depending on the flag_code. */ #define Cpu64 0x4000000 /* 64bit support required */ #define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ /* The default value for unknown CPUs - enable all features to avoid problems. */ -#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|CpuPNI|Cpu3dnow|CpuK6|CpuAthlon|CpuPadLock) +#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|CpuPNI|Cpu3dnow|CpuK6|CpuAthlon|CpuPadLock|CpuSSSE3) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of Modified: stable/8/contrib/binutils/include/opcode/ChangeLog ============================================================================== --- stable/8/contrib/binutils/include/opcode/ChangeLog Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/include/opcode/ChangeLog Thu Jul 14 14:23:48 2011 (r224017) @@ -1,3 +1,16 @@ +2006-09-28 H.J. Lu + + * i386.h: Replace CpuMNI with CpuSSSE3. + +2006-02-27 H.J. Lu + + * i386.h (i386_optab): Support Intel Merom New Instructions. + +2005-04-12 Mark Kettenis + + * i386.h (i386_optab): Mark VIA PadLock instructions as ImmExt and + adjust them accordingly. + 2004-04-08 Alan Modra Apply from mainline. Modified: stable/8/contrib/binutils/include/opcode/i386.h ============================================================================== --- stable/8/contrib/binutils/include/opcode/i386.h Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/include/opcode/i386.h Thu Jul 14 14:23:48 2011 (r224017) @@ -1326,6 +1326,41 @@ static const template i386_optab[] = { /* Need to ensure only "mwait %eax,%ecx" is accepted. */ {"mwait", 2, 0x0f01, 0xc9, CpuPNI, FP|ImmExt, { Reg32, Reg32, 0} }, +/* Supplemental Streaming SIMD extensions 3 Instructions. */ + +{"phaddw", 2, 0x0f3801,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"phaddw", 2, 0x660f3801,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"phaddd", 2, 0x0f3802,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"phaddd", 2, 0x660f3802,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"phaddsw", 2, 0x0f3803,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"phaddsw", 2, 0x660f3803,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"phsubw", 2, 0x0f3805,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"phsubw", 2, 0x660f3805,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"phsubd", 2, 0x0f3806,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"phsubd", 2, 0x660f3806,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"phsubsw", 2, 0x0f3807,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"phsubsw", 2, 0x660f3807,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"pmaddubsw", 2, 0x0f3804,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"pmaddubsw", 2, 0x660f3804,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"pmulhrsw", 2, 0x0f380b,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"pmulhrsw", 2, 0x660f380b,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"pshufb", 2, 0x0f3800,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"pshufb", 2, 0x660f3800,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"psignb", 2, 0x0f3808,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"psignb", 2, 0x660f3808,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"psignw", 2, 0x0f3809,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"psignw", 2, 0x660f3809,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"psignd", 2, 0x0f380a,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"psignd", 2, 0x660f380a,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"palignr", 3, 0x0f3a0f,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { Imm8, RegMMX|LongMem, RegMMX } }, +{"palignr", 3, 0x660f3a0f,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { Imm8, RegXMM|LLongMem, RegXMM } }, +{"pabsb", 2, 0x0f381c,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"pabsb", 2, 0x660f381c,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"pabsw", 2, 0x0f381d,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"pabsw", 2, 0x660f381d,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, +{"pabsd", 2, 0x0f381e,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegMMX|LongMem, RegMMX, 0 } }, +{"pabsd", 2, 0x660f381e,X, CpuSSSE3, NoSuf|IgnoreSize|Modrm, { RegXMM|LLongMem, RegXMM, 0 } }, + /* AMD 3DNow! instructions. */ {"prefetch", 1, 0x0f0d, 0, Cpu3dnow, FP|Modrm, { ByteMem, 0, 0 } }, @@ -1362,13 +1397,16 @@ static const template i386_optab[] = { {"swapgs", 0, 0x0f01, 0xf8, Cpu64, NoSuf|ImmExt, { 0, 0, 0} }, /* VIA PadLock extensions. */ -{"xstorerng", 0, 0x0fa7c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, -{"xcryptecb", 0, 0xf30fa7c8, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, -{"xcryptcbc", 0, 0xf30fa7d0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, -{"xcryptcfb", 0, 0xf30fa7e0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, -{"xcryptofb", 0, 0xf30fa7e8, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, -/* alias for xstorerng */ -{"xstore", 0, 0x0fa7c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, +{"xstorerng", 0, 0x000fa7, 0xc0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptecb", 0, 0xf30fa7, 0xc8, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptcbc", 0, 0xf30fa7, 0xd0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptcfb", 0, 0xf30fa7, 0xe0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptofb", 0, 0xf30fa7, 0xe8, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"montmul", 0, 0xf30fa6, 0xc0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xsha1", 0, 0xf30fa6, 0xc8, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xsha256", 0, 0xf30fa6, 0xd0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +/* Alias for xstorerng. */ +{"xstore", 0, 0x000fa7, 0xc0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, /* sentinel */ {NULL, 0, 0, 0, 0, 0, { 0, 0, 0} } Modified: stable/8/contrib/binutils/opcodes/ChangeLog ============================================================================== --- stable/8/contrib/binutils/opcodes/ChangeLog Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/opcodes/ChangeLog Thu Jul 14 14:23:48 2011 (r224017) @@ -1,3 +1,17 @@ +2006-02-27 H.J. Lu + + * i386-dis.c (IS_3BYTE_OPCODE): New for 3-byte opcodes used by + Intel Merom New Instructions. + (THREE_BYTE_0): Likewise. + (THREE_BYTE_1): Likewise. + (three_byte_table): Likewise. + (dis386_twobyte): Use THREE_BYTE_0 for entry 0x38. Use + THREE_BYTE_1 for entry 0x3a. + (twobyte_has_modrm): Updated. + (twobyte_uses_SSE_prefix): Likewise. + (print_insn): Handle 3-byte opcodes used by Intel Merom New + Instructions. + 2004-05-13 Nick Clifton * po/fr.po: Updated French translation. Modified: stable/8/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- stable/8/contrib/binutils/opcodes/i386-dis.c Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/contrib/binutils/opcodes/i386-dis.c Thu Jul 14 14:23:48 2011 (r224017) @@ -367,6 +367,7 @@ fetch_data (struct disassemble_info *inf #define USE_GROUPS 2 #define USE_PREFIX_USER_TABLE 3 #define X86_64_SPECIAL 4 +#define IS_3BYTE_OPCODE 5 #define FLOAT NULL, NULL, FLOATCODE, NULL, 0, NULL, 0 @@ -431,6 +432,9 @@ fetch_data (struct disassemble_info *inf #define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0 +#define THREE_BYTE_0 NULL, NULL, IS_3BYTE_OPCODE, NULL, 0, NULL, 0 +#define THREE_BYTE_1 NULL, NULL, IS_3BYTE_OPCODE, NULL, 1, NULL, 0 + typedef void (*op_rtn) (int bytemode, int sizeflag); struct dis386 { @@ -829,9 +833,9 @@ static const struct dis386 dis386_twobyt { "(bad)", XX, XX, XX }, { "(bad)", XX, XX, XX }, /* 38 */ + { THREE_BYTE_0 }, { "(bad)", XX, XX, XX }, - { "(bad)", XX, XX, XX }, - { "(bad)", XX, XX, XX }, + { THREE_BYTE_1 }, { "(bad)", XX, XX, XX }, { "(bad)", XX, XX, XX }, { "(bad)", XX, XX, XX }, @@ -1084,7 +1088,7 @@ static const unsigned char twobyte_has_m /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */ /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, /* 1f */ /* 20 */ 1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1, /* 2f */ - /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */ + /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */ /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */ /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */ /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */ @@ -1107,7 +1111,7 @@ static const unsigned char twobyte_uses_ /* 00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0f */ /* 10 */ 1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0, /* 1f */ /* 20 */ 0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0, /* 2f */ - /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */ + /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */ /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */ /* 50 */ 0,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* 5f */ /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1, /* 6f */ @@ -1709,6 +1713,79 @@ static const struct dis386 x86_64_table[ }, }; +static const struct dis386 three_byte_table[][32] = { + /* THREE_BYTE_0 */ + { + { "pshufb", MX, EM, XX }, + { "phaddw", MX, EM, XX }, + { "phaddd", MX, EM, XX }, + { "phaddsw", MX, EM, XX }, + { "pmaddubsw", MX, EM, XX }, + { "phsubw", MX, EM, XX }, + { "phsubd", MX, EM, XX }, + { "phsubsw", MX, EM, XX }, + { "psignb", MX, EM, XX }, + { "psignw", MX, EM, XX }, + { "psignd", MX, EM, XX }, + { "pmulhrsw", MX, EM, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "pabsb", MX, EM, XX }, + { "pabsw", MX, EM, XX }, + { "pabsd", MX, EM, XX }, + { "(bad)", XX, XX, XX } + }, + /* THREE_BYTE_1 */ + { + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "palignr", MX, EM, Ib }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX }, + { "(bad)", XX, XX, XX } + }, +}; + #define INTERNAL_DISASSEMBLER_ERROR _("") static void @@ -2160,7 +2237,15 @@ print_insn (bfd_vma pc, disassemble_info } } - if (need_modrm) + if (dp->name == NULL && dp->bytemode1 == IS_3BYTE_OPCODE) + { + FETCH_DATA (info, codep + 2); + dp = &three_byte_table[dp->bytemode2][*codep++]; + mod = (*codep >> 6) & 3; + reg = (*codep >> 3) & 7; + rm = *codep & 7; + } + else if (need_modrm) { FETCH_DATA (info, codep + 1); mod = (*codep >> 6) & 3; Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Thu Jul 14 14:18:14 2011 (r224016) +++ stable/8/sys/sys/param.h Thu Jul 14 14:23:48 2011 (r224017) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 802508 /* Master, propagated to newvers */ +#define __FreeBSD_version 802509 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 18:49:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C62861065670; Thu, 14 Jul 2011 18:49:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1498FC17; Thu, 14 Jul 2011 18: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 p6EInNCW041445; Thu, 14 Jul 2011 18:49:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EInN7S041440; Thu, 14 Jul 2011 18:49:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107141849.p6EInN7S041440@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jul 2011 18:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224032 - stable/8/sys/dev/puc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 18:49:23 -0000 Author: jhb Date: Thu Jul 14 18:49:23 2011 New Revision: 224032 URL: http://svn.freebsd.org/changeset/base/224032 Log: MFC 223091: Add location and pnpinfo strings for puc device ports. The location is announced during boot and contains the port number. The pnpinfo string lists the port type (PUC_TYPE_* constants). Modified: stable/8/sys/dev/puc/puc.c stable/8/sys/dev/puc/puc_bfe.h stable/8/sys/dev/puc/puc_pccard.c stable/8/sys/dev/puc/puc_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/puc/puc.c ============================================================================== --- stable/8/sys/dev/puc/puc.c Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc.c Thu Jul 14 18:49:23 2011 (r224032) @@ -726,3 +726,41 @@ puc_bus_read_ivar(device_t dev, device_t } return (0); } + +int +puc_bus_print_child(device_t dev, device_t child) +{ + struct puc_port *port; + int retval; + + port = device_get_ivars(child); + retval = 0; + + retval += bus_print_child_header(dev, child); + retval += printf(" at port %d", port->p_nr); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + +int +puc_bus_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + struct puc_port *port; + + port = device_get_ivars(child); + snprintf(buf, buflen, "port=%d", port->p_nr); + return (0); +} + +int +puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + struct puc_port *port; + + port = device_get_ivars(child); + snprintf(buf, buflen, "type=%d", port->p_type); + return (0); +} Modified: stable/8/sys/dev/puc/puc_bfe.h ============================================================================== --- stable/8/sys/dev/puc/puc_bfe.h Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc_bfe.h Thu Jul 14 18:49:23 2011 (r224032) @@ -82,9 +82,12 @@ int puc_bfe_attach(device_t); int puc_bfe_detach(device_t); int puc_bfe_probe(device_t, const struct puc_cfg *); +int puc_bus_child_location_str(device_t, device_t, char *, size_t); +int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t); struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *); +int puc_bus_print_child(device_t, device_t); int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *); int puc_bus_release_resource(device_t, device_t, int, int, struct resource *); int puc_bus_setup_intr(device_t, device_t, struct resource *, int, Modified: stable/8/sys/dev/puc/puc_pccard.c ============================================================================== --- stable/8/sys/dev/puc/puc_pccard.c Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc_pccard.c Thu Jul 14 18:49:23 2011 (r224032) @@ -82,7 +82,9 @@ static device_method_t puc_pccard_method DEVMETHOD(bus_read_ivar, puc_bus_read_ivar), DEVMETHOD(bus_setup_intr, puc_bus_setup_intr), DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr), - DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_print_child, puc_bus_print_child), + DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str), + DEVMETHOD(bus_child_location_str, puc_bus_child_location_str), DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } }; Modified: stable/8/sys/dev/puc/puc_pci.c ============================================================================== --- stable/8/sys/dev/puc/puc_pci.c Thu Jul 14 18:38:10 2011 (r224031) +++ stable/8/sys/dev/puc/puc_pci.c Thu Jul 14 18:49:23 2011 (r224032) @@ -132,7 +132,9 @@ static device_method_t puc_pci_methods[] DEVMETHOD(bus_read_ivar, puc_bus_read_ivar), DEVMETHOD(bus_setup_intr, puc_bus_setup_intr), DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr), - DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_print_child, puc_bus_print_child), + DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str), + DEVMETHOD(bus_child_location_str, puc_bus_child_location_str), DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } }; From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 18:58:19 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 099A7106566B; Thu, 14 Jul 2011 18:58:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E42B98FC17; Thu, 14 Jul 2011 18:58: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 p6EIwIPZ041752; Thu, 14 Jul 2011 18:58:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EIwIpH041750; Thu, 14 Jul 2011 18:58:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107141858.p6EIwIpH041750@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jul 2011 18:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224033 - stable/8/sys/boot/i386/zfsboot X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 18:58:19 -0000 Author: jhb Date: Thu Jul 14 18:58:18 2011 New Revision: 224033 URL: http://svn.freebsd.org/changeset/base/224033 Log: MFC 223477,223597,223611: - The recent change to increase the zfsboot size to 64k made a few BIOSes unhappy (probably they don't handle crossing the 64k boundary, etc.). Fix this by changing zfsldr to use a loop reading from the disk one sector at a time. To avoid trashing the saved copy of the MBR which is used for disk I/O, read zfsboot2 at address 0x9000. This has the advantage that BTX no longer needs to be relocated as it is read into the correct location. However, the loop to relocate zfsboot2.bin can now cross a 64k boundary, so change it to use relative segments instead. (This will need further work if zfsboot2.bin ever exceeds 64k.) While here, stop storing a relocated copy of zfsldr at 0x700. This was only used by the xread hack which has recently been removed (and even that use was dubious). Also, include the BIOS error code as hex when reporting read errors to aid in debugging. - Remove the fake BPB from zfsldr. zfsldr doesn't support booting from floppies, so it will not be used as the start of an emulated floppy image on a bootable CD which is what the fake BPB was used for. - Only check that EDD packet mode is available once at the start of zfsldr rather than for each disk sector now that we read data in one sector at a time. As a result, collapse the remaining bits of read up into nread and rename nread to read. Modified: stable/8/sys/boot/i386/zfsboot/zfsldr.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsldr.S Thu Jul 14 18:49:23 2011 (r224032) +++ stable/8/sys/boot/i386/zfsboot/zfsldr.S Thu Jul 14 18:58:18 2011 (r224033) @@ -16,7 +16,6 @@ */ /* Memory Locations */ - .set MEM_REL,0x700 # Relocation address .set MEM_ARG,0x900 # Arguments .set MEM_ORG,0x7c00 # Origin .set MEM_BUF,0x8000 # Load area @@ -38,43 +37,6 @@ .globl start .code16 -start: jmp main # Start recognizably - -/* - * This is the start of a standard BIOS Parameter Block (BPB). Most bootable - * FAT disks have this at the start of their MBR. While normal BIOS's will - * work fine without this section, IBM's El Torito emulation "fixes" up the - * BPB by writing into the memory copy of the MBR. Rather than have data - * written into our code, we'll define a BPB to work around it. - * The data marked with (T) indicates a field required for a ThinkPad to - * recognize the disk and (W) indicates fields written from IBM BIOS code. - * The use of the BPB is based on what OpenBSD and NetBSD implemented in - * their boot code but the required fields were determined by trial and error. - * - * Note: If additional space is needed in boot1, one solution would be to - * move the "prompt" message data (below) to replace the OEM ID. - */ - .org 0x03, 0x00 -oemid: .space 0x08, 0x00 # OEM ID - - .org 0x0b, 0x00 -bpb: .word 512 # sector size (T) - .byte 0 # sectors/clustor - .word 0 # reserved sectors - .byte 0 # number of FATs - .word 0 # root entries - .word 0 # small sectors - .byte 0 # media type (W) - .word 0 # sectors/fat - .word 18 # sectors per track (T) - .word 2 # number of heads (T) - .long 0 # hidden sectors (W) - .long 0 # large sectors - - .org 0x24, 0x00 -ebpb: .byte 0 # BIOS physical drive number (W) - - .org 0x25,0x90 /* * Load the rest of zfsboot2 and BTX up, copy the parts to the right locations, * and start it all up. @@ -84,33 +46,24 @@ ebpb: .byte 0 # BIOS physical drive nu * Setup the segment registers to flat addressing (segment 0) and setup the * stack to end just below the start of our code. */ -main: cld # String ops inc +start: cld # String ops inc xor %cx,%cx # Zero mov %cx,%es # Address mov %cx,%ds # data mov %cx,%ss # Set up mov $start,%sp # stack /* - * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets - * %cx == 0x100. - */ - mov %sp,%si # Source - mov $MEM_REL,%di # Destination - incb %ch # Word count - rep # Copy - movsw # code -/* - * If we are on a hard drive, then load the MBR and look for the first - * FreeBSD slice. We use the fake partition entry below that points to - * the MBR when we call nread. The first pass looks for the first active - * FreeBSD slice. The second pass looks for the first non-active FreeBSD - * slice if the first one fails. - */ - mov $part4,%si # Partition - cmpb $0x80,%dl # Hard drive? - jb main.4 # No - movb $0x1,%dh # Block count - callw nread # Read MBR + * Load the MBR and look for the first FreeBSD slice. We use the fake + * partition entry below that points to the MBR when we call read. + * The first pass looks for the first active FreeBSD slice. The + * second pass looks for the first non-active FreeBSD slice if the + * first one fails. + */ + call check_edd # Make sure EDD works + mov $part4,%si # Dummy partition + xor %eax,%eax # Read MBR + movl $MEM_BUF,%ebx # from first + call read # sector mov $0x1,%cx # Two passes main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table movb $0x1,%dh # Partition @@ -131,60 +84,55 @@ main.3: add $0x10,%si # Next entry */ mov $msg_part,%si # Message jmp error # Error -/* - * Floppies use partition 0 of drive 0. - */ -main.4: xor %dx,%dx # Partition:drive /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 64 sectors starting at sector 1024 + * for, so go ahead and load up the 128 sectors starting at sector 1024 * (i.e. after the two vdev labels). We don't have do anything fancy * here to allow for an extra copy of boot1 and a partition table * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x8000. The first part of boot2 is BTX, which wants to run + * all at 0x9000. The first part of boot2 is BTX, which wants to run * at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the - * binary to 0xc000. After we have moved the client, we relocate BTX - * itself to 0x9000 - doing it in this order means that none of the - * memcpy regions overlap which would corrupt the copy. Normally, BTX - * clients start at MEM_USR, or 0xa000, but when we use btxld to - * create zfsboot2, we use an entry point of 0x2000. That entry point is - * relative to MEM_USR; thus boot2.bin starts at 0xc000. + * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, + * but when we use btxld to create zfsboot2, we use an entry point of + * 0x2000. That entry point is relative to MEM_USR; thus boot2.bin + * starts at 0xc000. * * The load area and the target area for the client overlap so we have * to use a decrementing string move. We also play segment register * games with the destination address for the move so that the client * can be larger than 16k (which would overflow the zero segment since - * the client starts at 0xc000). Relocating BTX is easy since the load - * area and target area do not overlap. + * the client starts at 0xc000). */ main.5: mov %dx,MEM_ARG # Save args - movb $NSECT,%dh # Sector count + mov $NSECT,%cx # Sector count movl $1024,%eax # Offset to boot2 - callw nread.1 # Read disk -main.6: mov $MEM_BUF,%si # BTX (before reloc) - mov 0xa(%si),%bx # Get BTX length and set + mov $MEM_BTX,%ebx # Destination buffer +main.6: pushal # Save params + call read # Read disk + popal # Restore + incl %eax # Advance to + add $SIZ_SEC,%ebx # next sector + loop main.6 # If not last, read another + mov MEM_BTX+0xa,%bx # Get BTX length mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load - add $MEM_BUF,%si # area + mov %di,%si # End of load area, 0x9000 rel sub %bx,%di # End of client, 0xc000 rel mov %di,%cx # Size of inc %cx # client + mov $(MEM_BTX)>>4,%dx # Segment + mov %dx,%ds # addressing 0x9000 mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment mov %dx,%es # addressing 0xc000 std # Move with decrement rep # Relocate movsb # client - mov %ds,%dx # Back to - mov %dx,%es # zero segment - mov $MEM_BUF,%si # BTX (before reloc) - mov $MEM_BTX,%di # BTX - mov %bx,%cx # Get BTX length - cld # Increment this time - rep # Relocate - movsb # BTX + cld # Back to increment + xor %dx,%dx # Back + mov %ds,%dx # to zero + mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. @@ -210,33 +158,37 @@ seta20.3: sti # Enable interrupts /* - * Trampoline used to call read from within zfsldr. Sets up an EDD - * packet on the stack and passes it to read. + * Read a sector from the disk. Sets up an EDD packet on the stack + * and passes it to read. We assume that the destination address is + * always segment-aligned. * * %eax - int - LBA to read in relative to partition start + * %ebx - ptr - destination address * %dl - byte - drive to read from - * %dh - byte - num sectors to read * %si - ptr - MBR partition entry */ -nread: xor %eax,%eax # Sector offset in partition -nread.1: xor %ecx,%ecx # Get +read: xor %ecx,%ecx # Get addl 0x8(%si),%eax # LBA adc $0,%ecx pushl %ecx # Starting absolute block pushl %eax # block number - push %es # Address of - push $MEM_BUF # transfer buffer - xor %ax,%ax # Number of - movb %dh,%al # blocks to - push %ax # transfer + shr $4,%ebx # Convert to segment + push %bx # Address of + push $0 # transfer buffer + push $0x1 # Read 1 sector push $0x10 # Size of packet - mov %sp,%bp # Packet pointer - callw read # Read from disk - lea 0x10(%bp),%sp # Clear stack - jnc return # If success, return - mov $msg_read,%si # Otherwise, set the error - # message and fall through to - # the error routine + mov %sp,%si # Packet pointer + mov $0x42,%ah # BIOS: Extended + int $0x13 # read + jc read.1 # If error, fail + lea 0x10(%si),%sp # Clear stack + ret # If success, return +read.1: mov %ah,%al # Format + mov $read_err,%di # error + call hex8 # code + mov $msg_read,%si # Set the error message and + # fall through to the error + # routine /* * Print out the error message pointed to by %ds:(%si) followed * by a prompt, wait for a keypress, and then reboot the machine. @@ -257,51 +209,49 @@ putstr.0: mov $0x7,%bx # Page:attribu putstr: lodsb # Get char testb %al,%al # End of string? jne putstr.0 # No - + ret # To caller /* - * Overused return code. ereturn is used to return an error from the - * read function. Since we assume putstr succeeds, we (ab)use the - * same code when we return from putstr. - */ -ereturn: movb $0x1,%ah # Invalid - stc # argument -return: retw # To caller -/* - * Reads sectors from the disk. If EDD is enabled, then check if it is - * installed and use it if it is. If it is not installed or not enabled, then - * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to - * fetch the drive parameters from the BIOS and divide it out ourselves. - * Call with: - * - * %dl - byte - drive number - * stack - 10 bytes - EDD Packet + * Check to see if the disk supports EDD. zfsboot requires EDD and does not + * support older C/H/S disk I/O. */ -read: cmpb $0x80,%dl # Hard drive? - jb read.1 # No, use CHS +check_edd: cmpb $0x80,%dl # Hard drive? + jb check_edd.1 # No, fail to boot mov $0x55aa,%bx # Magic push %dx # Save movb $0x41,%ah # BIOS: Check int $0x13 # extensions present pop %dx # Restore - jc read.1 # If error, use CHS + jc check_edd.1 # If error, fail cmp $0xaa55,%bx # Magic? - jne read.1 # No, so use CHS + jne check_edd.1 # No, so fail testb $0x1,%cl # Packet interface? - jz read.1 # No, so use CHS - mov %bp,%si # Disk packet - movb $0x42,%ah # BIOS: Extended - int $0x13 # read - retw # To caller -read.1: mov $msg_chs,%si - jmp error -msg_chs: .asciz "CHS not supported" + jz check_edd.1 # No, so fail + ret # EDD ok, keep booting +check_edd.1: mov $msg_chs,%si # Warn that CHS is + jmp error # unsupported and fail +/* + * AL to hex, saving the result to [EDI]. + */ +hex8: push %ax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + pop %ax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + stosb # Save char + ret # (Recursive) /* Messages */ -msg_read: .asciz "Read" -msg_part: .asciz "Boot" +msg_chs: .asciz "CHS not supported" +msg_read: .ascii "Read error: " +read_err: .asciz "XX" +msg_part: .asciz "Boot error" -prompt: .asciz " error\r\n" +prompt: .asciz "\r\n" .org PRT_OFF,0x90 From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 19:05:48 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C32F0106566B; Thu, 14 Jul 2011 19:05:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8F7F8FC08; Thu, 14 Jul 2011 19:05: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 p6EJ5mtR042029; Thu, 14 Jul 2011 19:05:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EJ5mEl042027; Thu, 14 Jul 2011 19:05:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107141905.p6EJ5mEl042027@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jul 2011 19:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224034 - stable/8/usr.sbin/mtest X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 19:05:49 -0000 Author: jhb Date: Thu Jul 14 19:05:48 2011 New Revision: 224034 URL: http://svn.freebsd.org/changeset/base/224034 Log: MFC 223510: Don't die if either of INET or INET6 aren't in the running kernel. Instead, report "protocol not supported" errors at runtime if a user attempts to use a protocol that the kernel doesn't support. Modified: stable/8/usr.sbin/mtest/mtest.c Directory Properties: stable/8/usr.sbin/mtest/ (props changed) Modified: stable/8/usr.sbin/mtest/mtest.c ============================================================================== --- stable/8/usr.sbin/mtest/mtest.c Thu Jul 14 18:58:18 2011 (r224033) +++ stable/8/usr.sbin/mtest/mtest.c Thu Jul 14 19:05:48 2011 (r224034) @@ -204,14 +204,16 @@ main(int argc, char **argv) s6 = -1; #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (s == -1) + if (s == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv4 socket"); #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); - if (s6 == -1) + if (s6 == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv6 socket"); #endif + if (s == -1 && s6 == -1) + errc(1, EPROTONOSUPPORT, "can't open socket"); if (argc < 2) { if (isatty(STDIN_FILENO)) { @@ -371,7 +373,7 @@ af2socklen(const int af) } static void -process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) +process_cmd(char *cmd, int s, int s6, FILE *fp __unused) { char str1[STR_SIZE]; char str2[STR_SIZE]; @@ -457,7 +459,10 @@ process_cmd(char *cmd, int s, int s6 __u optval = (void *)&mr.mr; optlen = sizeof(mr.mr); } - if (setsockopt(s, level, optname, optval, + if (s < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -496,7 +501,10 @@ process_cmd(char *cmd, int s, int s6 __u optval = (void *)&mr.mr6; optlen = sizeof(mr.mr6); } - if (setsockopt(s6, level, optname, optval, + if (s6 < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s6, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -534,6 +542,10 @@ process_cmd(char *cmd, int s, int s6 __u break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "setsourcefilter"); + break; + } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; @@ -593,6 +605,10 @@ process_cmd(char *cmd, int s, int s6 __u break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } /* First determine our current filter mode. */ n = 0; @@ -700,6 +716,10 @@ process_cmd(char *cmd, int s, int s6 __u } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } nsrc = nreqsrc; if (getsourcefilter(af2sock(af, s, s6), ifindex, &su.sa, su.sa.sa_len, &fmode, &nsrc, &sources[0].ss) != 0) { From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 19:09:49 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33401106566C; Thu, 14 Jul 2011 19:09:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2347E8FC1B; Thu, 14 Jul 2011 19:09:49 +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 p6EJ9nnI042187; Thu, 14 Jul 2011 19:09:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EJ9nqP042185; Thu, 14 Jul 2011 19:09:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107141909.p6EJ9nqP042185@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jul 2011 19:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224035 - stable/8/usr.bin/top X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 19:09:49 -0000 Author: jhb Date: Thu Jul 14 19:09:48 2011 New Revision: 224035 URL: http://svn.freebsd.org/changeset/base/224035 Log: MFC 223841: Always skip the kernel idle process if requested, it is not specific to the 'CPU' mode. Modified: stable/8/usr.bin/top/machine.c Directory Properties: stable/8/usr.bin/top/ (props changed) Modified: stable/8/usr.bin/top/machine.c ============================================================================== --- stable/8/usr.bin/top/machine.c Thu Jul 14 19:05:48 2011 (r224034) +++ stable/8/usr.bin/top/machine.c Thu Jul 14 19:09:48 2011 (r224035) @@ -701,17 +701,16 @@ get_process_info(struct system_info *si, /* skip zombies */ continue; + if (!show_kidle && pp->ki_tdflags & TDF_IDLETD) + /* skip kernel idle process */ + continue; + if (displaymode == DISP_CPU && !show_idle && (pp->ki_pctcpu == 0 || pp->ki_stat == SSTOP || pp->ki_stat == SIDL)) /* skip idle or non-running processes */ continue; - if (displaymode == DISP_CPU && !show_kidle && - pp->ki_tdflags & TDF_IDLETD) - /* skip kernel idle process */ - continue; - if (displaymode == DISP_IO && !show_idle && p_io == 0) /* skip processes that aren't doing I/O */ continue; From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 19:25:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4A8F106566B; Thu, 14 Jul 2011 19:25:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3E38FC19; Thu, 14 Jul 2011 19:25: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 p6EJPUnN042757; Thu, 14 Jul 2011 19:25:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EJPUnx042754; Thu, 14 Jul 2011 19:25:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107141925.p6EJPUnx042754@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jul 2011 19:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224037 - stable/8/contrib/top X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 19:25:30 -0000 Author: jhb Date: Thu Jul 14 19:25:30 2011 New Revision: 224037 URL: http://svn.freebsd.org/changeset/base/224037 Log: MFC 223870,223937: - Note that -a, -C, -H, -j, and -z are also toggles. - Add a leading space to the status messages output after toggling the 'C' and 'H' flags at runtime. This matches messages output for other toggles which leave the first column in the message blank to hold the cursor. Modified: stable/8/contrib/top/top.X stable/8/contrib/top/top.c Directory Properties: stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) Modified: stable/8/contrib/top/top.X ============================================================================== --- stable/8/contrib/top/top.X Thu Jul 14 19:18:17 2011 (r224036) +++ stable/8/contrib/top/top.X Thu Jul 14 19:25:30 2011 (r224037) @@ -200,11 +200,16 @@ a user to set his or her own defaults. can also be specified in the environment variable .BR TOP . The options +.BR \-a , +.BR \-C , +.BR \-H , .BR \-I , +.BR \-j , .BR \-S , +.BR \-t , .BR \-u , and -.B \-t +.B \-z are actually toggles. A second specification of any of these options will negate the first. Thus a user who has the environment variable .B TOP Modified: stable/8/contrib/top/top.c ============================================================================== --- stable/8/contrib/top/top.c Thu Jul 14 19:18:17 2011 (r224036) +++ stable/8/contrib/top/top.c Thu Jul 14 19:25:30 2011 (r224037) @@ -1019,7 +1019,7 @@ restart: case CMD_thrtog: ps.thread = !ps.thread; new_message(MT_standout | MT_delayed, - "Displaying threads %s", + " Displaying threads %s", ps.thread ? "separately" : "as a count"); header_text = format_header(uname_field); reset_display(); @@ -1028,7 +1028,7 @@ restart: case CMD_wcputog: ps.wcpu = !ps.wcpu; new_message(MT_standout | MT_delayed, - "Displaying %sCPU", + " Displaying %sCPU", ps.wcpu ? "W" : ""); header_text = format_header(uname_field); reset_display(); From owner-svn-src-stable@FreeBSD.ORG Thu Jul 14 19:25:43 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10DEA1065678; Thu, 14 Jul 2011 19:25:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC5C68FC16; Thu, 14 Jul 2011 19:25: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 p6EJPgAS042799; Thu, 14 Jul 2011 19:25:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6EJPgwP042796; Thu, 14 Jul 2011 19:25:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107141925.p6EJPgwP042796@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jul 2011 19:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224038 - stable/7/contrib/top X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2011 19:25:43 -0000 Author: jhb Date: Thu Jul 14 19:25:42 2011 New Revision: 224038 URL: http://svn.freebsd.org/changeset/base/224038 Log: MFC 223870,223937: - Note that -a, -C, -H, -j, and -z are also toggles. - Add a leading space to the status messages output after toggling the 'C' and 'H' flags at runtime. This matches messages output for other toggles which leave the first column in the message blank to hold the cursor. Modified: stable/7/contrib/top/top.X stable/7/contrib/top/top.c Directory Properties: stable/7/contrib/top/ (props changed) Modified: stable/7/contrib/top/top.X ============================================================================== --- stable/7/contrib/top/top.X Thu Jul 14 19:25:30 2011 (r224037) +++ stable/7/contrib/top/top.X Thu Jul 14 19:25:42 2011 (r224038) @@ -197,11 +197,15 @@ a user to set his or her own defaults. can also be specified in the environment variable .BR TOP . The options +.BR \-a , +.BR \-C , +.BR \-H , .BR \-I , +.BR \-j , .BR \-S , -.BR \-u , +.BR \-t , and -.B \-t +.B \-u are actually toggles. A second specification of any of these options will negate the first. Thus a user who has the environment variable .B TOP Modified: stable/7/contrib/top/top.c ============================================================================== --- stable/7/contrib/top/top.c Thu Jul 14 19:25:30 2011 (r224037) +++ stable/7/contrib/top/top.c Thu Jul 14 19:25:42 2011 (r224038) @@ -1013,7 +1013,7 @@ restart: case CMD_thrtog: ps.thread = !ps.thread; new_message(MT_standout | MT_delayed, - "Displaying threads %s", + " Displaying threads %s", ps.thread ? "separately" : "as a count"); header_text = format_header(uname_field); reset_display(); @@ -1022,7 +1022,7 @@ restart: case CMD_wcputog: ps.wcpu = !ps.wcpu; new_message(MT_standout | MT_delayed, - "Displaying %sCPU", + " Displaying %sCPU", ps.wcpu ? "W" : ""); header_text = format_header(uname_field); reset_display(); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 15 18:10:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8F4F106566B; Fri, 15 Jul 2011 18:10:59 +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 A85168FC0A; Fri, 15 Jul 2011 18:10: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 p6FIAxwU090270; Fri, 15 Jul 2011 18:10:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6FIAxmZ090268; Fri, 15 Jul 2011 18:10:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107151810.p6FIAxmZ090268@svn.freebsd.org> From: Xin LI Date: Fri, 15 Jul 2011 18:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224065 - stable/8/usr.sbin/pw X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 18:10:59 -0000 Author: delphij Date: Fri Jul 15 18:10:59 2011 New Revision: 224065 URL: http://svn.freebsd.org/changeset/base/224065 Log: MFC r223115: Don't attempt to create the base directory when -d is specified. Modified: stable/8/usr.sbin/pw/pw_user.c Directory Properties: stable/8/usr.sbin/pw/ (props changed) Modified: stable/8/usr.sbin/pw/pw_user.c ============================================================================== --- stable/8/usr.sbin/pw/pw_user.c Fri Jul 15 17:36:11 2011 (r224064) +++ stable/8/usr.sbin/pw/pw_user.c Fri Jul 15 18:10:59 2011 (r224065) @@ -170,7 +170,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) { + if ((arg != NULL || getarg(args, 'm') != NULL) && (getarg(args, 'd') == NULL)) { int l = strlen(cnf->home); if (l > 1 && cnf->home[l-1] == '/') /* Shave off any trailing path delimiter */ From owner-svn-src-stable@FreeBSD.ORG Fri Jul 15 21:30:51 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53EA3106564A; Fri, 15 Jul 2011 21:30:51 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42DCF8FC0C; Fri, 15 Jul 2011 21:30:51 +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 p6FLUpoG096671; Fri, 15 Jul 2011 21:30:51 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6FLUpqd096669; Fri, 15 Jul 2011 21:30:51 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201107152130.p6FLUpqd096669@svn.freebsd.org> From: Matt Jacob Date: Fri, 15 Jul 2011 21:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224070 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 21:30:51 -0000 Author: mjacob Date: Fri Jul 15 21:30:50 2011 New Revision: 224070 URL: http://svn.freebsd.org/changeset/base/224070 Log: MFC of 197332: Remember to unlock the peripheral prior to notifying the user. Make some allocations M_NOWAIT so that we don't try and sleep with a nested non-sleepable lock. This makes the userland scsi_target begin to function again. Modified: stable/8/sys/cam/scsi/scsi_target.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_target.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_target.c Fri Jul 15 21:08:58 2011 (r224069) +++ stable/8/sys/cam/scsi/scsi_target.c Fri Jul 15 21:30:50 2011 (r224070) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +/* Includes to support callout */ +#include +#include #include #include @@ -50,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include + /* Transaction information attached to each CCB sent by the user */ struct targ_cmd_descr { struct cam_periph_map_info mapinfo; @@ -92,6 +96,8 @@ struct targ_softc { targ_state state; struct selinfo read_select; struct devstat device_stats; + struct callout destroy_dev_callout; + struct mtx destroy_mtx; }; static d_open_t targopen; @@ -151,6 +157,7 @@ static void abort_all_pending(struct ta static void notify_user(struct targ_softc *softc); static int targcamstatus(cam_status status); static size_t targccblen(xpt_opcode func_code); +static void targdestroy(void *); static struct periph_driver targdriver = { @@ -208,10 +215,18 @@ targclose(struct cdev *dev, int flag, in int error; softc = (struct targ_softc *)dev->si_drv1; - if ((softc->periph == NULL) || - (softc->state & TARG_STATE_LUN_ENABLED) == 0) { + mtx_init(&softc->destroy_mtx, "targ_destroy", "SCSI Target dev destroy", MTX_DEF); + callout_init_mtx(&softc->destroy_dev_callout, &softc->destroy_mtx, CALLOUT_RETURNUNLOCKED); + if (softc->periph == NULL) { +#if 0 destroy_dev(dev); free(softc, M_TARG); +#endif + printf("%s: destroying non-enabled target\n", __func__); + mtx_lock(&softc->destroy_mtx); + callout_reset(&softc->destroy_dev_callout, hz / 2, + (void *)targdestroy, (void *)dev); + mtx_unlock(&softc->destroy_mtx); return (0); } @@ -223,18 +238,23 @@ targclose(struct cdev *dev, int flag, in cam_periph_acquire(periph); cam_periph_lock(periph); error = targdisable(softc); - if (error == CAM_REQ_CMP) { - dev->si_drv1 = 0; - if (softc->periph != NULL) { - cam_periph_invalidate(softc->periph); - softc->periph = NULL; - } - destroy_dev(dev); - free(softc, M_TARG); + if (softc->periph != NULL) { + cam_periph_invalidate(softc->periph); + softc->periph = NULL; } cam_periph_unlock(periph); cam_periph_release(periph); +#if 0 + destroy_dev(dev); + free(softc, M_TARG); +#endif + + printf("%s: close finished error(%d)\n", __func__, error); + mtx_lock(&softc->destroy_mtx); + callout_reset(&softc->destroy_dev_callout, hz / 2, + (void *)targdestroy, (void *)dev); + mtx_unlock(&softc->destroy_mtx); return (error); } @@ -818,7 +838,9 @@ targdone(struct cam_periph *periph, unio case XPT_CONT_TARGET_IO: TAILQ_INSERT_TAIL(&softc->user_ccb_queue, &done_ccb->ccb_h, periph_links.tqe); + cam_periph_unlock(softc->periph); notify_user(softc); + cam_periph_lock(softc->periph); break; default: panic("targdone: impossible xpt opcode %#x", @@ -966,13 +988,19 @@ targgetccb(struct targ_softc *softc, xpt int ccb_len; ccb_len = targccblen(type); - ccb = malloc(ccb_len, M_TARG, M_WAITOK); + ccb = malloc(ccb_len, M_TARG, M_NOWAIT); CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb)); - + if (ccb == NULL) { + return (ccb); + } xpt_setup_ccb(&ccb->ccb_h, softc->path, priority); ccb->ccb_h.func_code = type; ccb->ccb_h.cbfcnp = targdone; ccb->ccb_h.targ_descr = targgetdescr(softc); + if (ccb->ccb_h.targ_descr == NULL) { + free (ccb, M_TARG); + ccb = NULL; + } return (ccb); } @@ -1010,8 +1038,10 @@ targgetdescr(struct targ_softc *softc) struct targ_cmd_descr *descr; descr = malloc(sizeof(*descr), M_TARG, - M_WAITOK); - descr->mapinfo.num_bufs_used = 0; + M_NOWAIT); + if (descr) { + descr->mapinfo.num_bufs_used = 0; + } return (descr); } @@ -1091,8 +1121,11 @@ abort_all_pending(struct targ_softc *sof /* If we aborted anything from the work queue, wakeup user. */ if (!TAILQ_EMPTY(&softc->user_ccb_queue) - || !TAILQ_EMPTY(&softc->abort_queue)) + || !TAILQ_EMPTY(&softc->abort_queue)) { + cam_periph_unlock(softc->periph); notify_user(softc); + cam_periph_lock(softc->periph); + } } /* Notify the user that data is ready */ @@ -1185,3 +1218,25 @@ targccblen(xpt_opcode func_code) return (len); } + +/* + * work around to destroy targ device + * outside of targclose + */ +static void +targdestroy(void *dev) +{ + struct cdev *device = (struct cdev *)dev; + struct targ_softc *softc = (struct targ_softc *)device->si_drv1; + +#if 0 + callout_stop(&softc->destroy_dev_callout); +#endif + + mtx_unlock(&softc->destroy_mtx); + mtx_destroy(&softc->destroy_mtx); + free(softc, M_TARG); + device->si_drv1 = 0; + destroy_dev(device); + printf("%s: destroyed dev\n", __func__); +} From owner-svn-src-stable@FreeBSD.ORG Sat Jul 16 19:28:43 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3740106564A; Sat, 16 Jul 2011 19:28:43 +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 A2A958FC14; Sat, 16 Jul 2011 19: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 p6GJShmn041070; Sat, 16 Jul 2011 19:28:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6GJSha5041068; Sat, 16 Jul 2011 19:28:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107161928.p6GJSha5041068@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Jul 2011 19:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224109 - stable/8/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2011 19:28:43 -0000 Author: kib Date: Sat Jul 16 19:28:43 2011 New Revision: 224109 URL: http://svn.freebsd.org/changeset/base/224109 Log: MFC r223884: Implement bitcount16. Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/sys/systm.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Sat Jul 16 19:25:47 2011 (r224108) +++ stable/8/sys/sys/systm.h Sat Jul 16 19:28:43 2011 (r224109) @@ -380,4 +380,15 @@ bitcount32(uint32_t x) return (x); } +static __inline uint16_t +bitcount16(uint32_t x) +{ + + x = (x & 0x5555) + ((x & 0xaaaa) >> 1); + x = (x & 0x3333) + ((x & 0xcccc) >> 2); + x = (x + (x >> 4)) & 0x0f0f; + x = (x + (x >> 8)) & 0x00ff; + return (x); +} + #endif /* !_SYS_SYSTM_H_ */ From owner-svn-src-stable@FreeBSD.ORG Sat Jul 16 19:38:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437F81065670; Sat, 16 Jul 2011 19:38:09 +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 32A948FC15; Sat, 16 Jul 2011 19:38: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 p6GJc91u041436; Sat, 16 Jul 2011 19:38:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6GJc9b7041433; Sat, 16 Jul 2011 19:38:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107161938.p6GJc9b7041433@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Jul 2011 19:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224111 - stable/8/sys/dev/pci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2011 19:38:09 -0000 Author: kib Date: Sat Jul 16 19:38:08 2011 New Revision: 224111 URL: http://svn.freebsd.org/changeset/base/224111 Log: MFC r223885: Implement pci_find_class(9), the function to find a pci device by its class. Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pcivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Sat Jul 16 19:35:44 2011 (r224110) +++ stable/8/sys/dev/pci/pci.c Sat Jul 16 19:38:08 2011 (r224111) @@ -341,6 +341,21 @@ pci_find_device(uint16_t vendor, uint16_ return (NULL); } +device_t +pci_find_class(uint8_t class, uint8_t subclass) +{ + struct pci_devinfo *dinfo; + + STAILQ_FOREACH(dinfo, &pci_devq, pci_links) { + if (dinfo->cfg.baseclass == class && + dinfo->cfg.subclass == subclass) { + return (dinfo->cfg.dev); + } + } + + return (NULL); +} + static int pci_printf(pcicfgregs *cfg, const char *fmt, ...) { Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Sat Jul 16 19:35:44 2011 (r224110) +++ stable/8/sys/dev/pci/pcivar.h Sat Jul 16 19:38:08 2011 (r224111) @@ -450,6 +450,7 @@ pci_msix_count(device_t dev) device_t pci_find_bsf(uint8_t, uint8_t, uint8_t); device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t); device_t pci_find_device(uint16_t, uint16_t); +device_t pci_find_class(uint8_t class, uint8_t subclass); /* Can be used by drivers to manage the MSI-X table. */ int pci_pending_msix(device_t dev, u_int index); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 16 20:03:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B02291065670; Sat, 16 Jul 2011 20:03:23 +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 9F1138FC16; Sat, 16 Jul 2011 20:03: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 p6GK3NUg042272; Sat, 16 Jul 2011 20:03:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6GK3N0O042269; Sat, 16 Jul 2011 20:03:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107162003.p6GK3N0O042269@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Jul 2011 20:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224113 - in stable/8/sys: sys ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2011 20:03:23 -0000 Author: kib Date: Sat Jul 16 20:03:23 2011 New Revision: 224113 URL: http://svn.freebsd.org/changeset/base/224113 Log: MFC r223886: Implement a helper functions to locally set thread-private flag, and restore it to the previous state. Note that only setting a flag locally is supported. MFC r223887: Use helper functions instead of manually managing TDP_INBDFLUSH. MFC r223888: Use 'curthread_pflags' instead of 'thread_pflags' to signify that only curthread can be operated upon. Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/sys/proc.h stable/8/sys/ufs/ffs/ffs_balloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Sat Jul 16 19:56:07 2011 (r224112) +++ stable/8/sys/sys/proc.h Sat Jul 16 20:03:23 2011 (r224113) @@ -897,6 +897,25 @@ void thread_unthread(struct thread *td); void thread_wait(struct proc *p); struct thread *thread_find(struct proc *p, lwpid_t tid); +static __inline int +curthread_pflags_set(int flags) +{ + struct thread *td; + int save; + + td = curthread; + save = ~flags | (td->td_pflags & flags); + td->td_pflags |= flags; + return (save); +} + +static __inline void +curthread_pflags_restore(int save) +{ + + curthread->td_pflags &= save; +} + #endif /* _KERNEL */ #endif /* !_SYS_PROC_H_ */ Modified: stable/8/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_balloc.c Sat Jul 16 19:56:07 2011 (r224112) +++ stable/8/sys/ufs/ffs/ffs_balloc.c Sat Jul 16 20:03:23 2011 (r224113) @@ -228,9 +228,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t if (num < 1) panic ("ffs_balloc_ufs1: ufs_getlbns returned indirect block"); #endif - saved_inbdflush = ~TDP_INBDFLUSH | (curthread->td_pflags & - TDP_INBDFLUSH); - curthread->td_pflags |= TDP_INBDFLUSH; + saved_inbdflush = curthread_pflags_set(TDP_INBDFLUSH); /* * Fetch the first indirect block allocating if necessary. */ @@ -244,7 +242,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t pref = ffs_blkpref_ufs1(ip, lbn, 0, (ufs1_daddr_t *)0); if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags, cred, &newb)) != 0) { - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); return (error); } nb = newb; @@ -337,7 +335,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t * If asked only for the indirect block, then return it. */ if (flags & BA_METAONLY) { - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); *bpp = bp; return (0); } @@ -375,7 +373,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t bp->b_flags |= B_CLUSTEROK; bdwrite(bp); } - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); *bpp = nbp; return (0); } @@ -397,11 +395,11 @@ ffs_balloc_ufs1(struct vnode *vp, off_t nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); } - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); *bpp = nbp; return (0); fail: - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); /* * If we have failed to allocate any blocks, simply return the error. * This is the usual case and avoids the need to fsync the file. @@ -734,9 +732,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t if (num < 1) panic ("ffs_balloc_ufs2: ufs_getlbns returned indirect block"); #endif - saved_inbdflush = ~TDP_INBDFLUSH | (curthread->td_pflags & - TDP_INBDFLUSH); - curthread->td_pflags |= TDP_INBDFLUSH; + saved_inbdflush = curthread_pflags_set(TDP_INBDFLUSH); /* * Fetch the first indirect block allocating if necessary. */ @@ -750,7 +746,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t pref = ffs_blkpref_ufs2(ip, lbn, 0, (ufs2_daddr_t *)0); if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags, cred, &newb)) != 0) { - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); return (error); } nb = newb; @@ -843,7 +839,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t * If asked only for the indirect block, then return it. */ if (flags & BA_METAONLY) { - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); *bpp = bp; return (0); } @@ -881,7 +877,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t bp->b_flags |= B_CLUSTEROK; bdwrite(bp); } - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); *bpp = nbp; return (0); } @@ -909,11 +905,11 @@ ffs_balloc_ufs2(struct vnode *vp, off_t nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, 0); nbp->b_blkno = fsbtodb(fs, nb); } - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); *bpp = nbp; return (0); fail: - curthread->td_pflags &= saved_inbdflush; + curthread_pflags_restore(saved_inbdflush); /* * If we have failed to allocate any blocks, simply return the error. * This is the usual case and avoids the need to fsync the file.